diff options
| author | ozturkemre <ozturkemry@gmail.com> | 2018-03-28 13:26:44 +0300 |
|---|---|---|
| committer | pranavk <pranavk@collabora.co.uk> | 2018-04-02 17:09:04 +0200 |
| commit | d990423011fed42a78b8fe4376ba2b17922957f1 (patch) | |
| tree | a20a834bd31afa9c54fb03fffa7e63df64d0ce28 | |
| parent | 2f620c3a3103248286c8f81d7111a3f3191bb5dd (diff) | |
tdf#116406 insert sheet now jump to correct sheet
Change-Id: I0bd6b35a3086283202a155bead6d666b42f0502c
Reviewed-on: https://gerrit.libreoffice.org/51368
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
| -rw-r--r-- | loleaflet/dist/toolbar.css | 1 | ||||
| -rw-r--r-- | loleaflet/dist/toolbar/toolbar.js | 14 |
2 files changed, 9 insertions, 6 deletions
diff --git a/loleaflet/dist/toolbar.css b/loleaflet/dist/toolbar.css index d18e62f65..1e16ef1a1 100644 --- a/loleaflet/dist/toolbar.css +++ b/loleaflet/dist/toolbar.css @@ -274,6 +274,7 @@ button.leaflet-control-search-next .w2ui-icon.help{ background: url('../images/lc_helpindex.svg') no-repeat center !important; } .w2ui-icon.incrementindent{ background: url('../images/lc_decrementlevel.svg') no-repeat center !important; } .w2ui-icon.insertpage{ background: url('../images/lc_insertpage.svg') no-repeat center !important; } +.w2ui-icon.insertsheet{ background: url('../images/plus.svg') no-repeat center !important; } .w2ui-icon.italic{ background: url('../images/lc_italic.svg') no-repeat center !important; } .w2ui-icon.insertgraphic{ background: url('../images/lc_gallery.svg') no-repeat center !important; } .w2ui-icon.inserttable{ background: url('../images/lc_inserttable.svg') no-repeat center !important; } diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js index 586de601f..f2ee8690f 100644 --- a/loleaflet/dist/toolbar/toolbar.js +++ b/loleaflet/dist/toolbar/toolbar.js @@ -277,6 +277,11 @@ function onClick(id, item, subItem) { callback: onDelete }); } + else if (id === 'insertsheet') { + var nPos = $('#spreadsheet-tab-scroll')[0].childElementCount; + map.insertPage(nPos + 1); + $('#spreadsheet-tab-scroll').scrollLeft($('#spreadsheet-tab-scroll').prop('scrollWidth')); + } else if (id === 'firstrecord') { $('#spreadsheet-tab-scroll').scrollLeft(0); } @@ -290,9 +295,6 @@ function onClick(id, item, subItem) { else if (id === 'lastrecord') { $('#spreadsheet-tab-scroll').scrollLeft($('#spreadsheet-tab-scroll').scrollLeft() + 120); } - else if (id === 'insertpage') { - $('#spreadsheet-tab-scroll').scrollLeft($('#spreadsheet-tab-scroll').prop('scrollWidth')); - } else if (id.startsWith('menu:wrap:wrap-')) { var wrapType = id.substring('menu:wrap:wrap-'.length); @@ -645,7 +647,7 @@ $(function () { {type: 'button', id: 'prevrecord', img: 'prevrecord', hidden: true, hint: _('Previous sheet')}, {type: 'button', id: 'nextrecord', img: 'nextrecord', hidden: true, hint: _('Next sheet')}, {type: 'button', id: 'lastrecord', img: 'lastrecord', hidden: true, hint: _('Last sheet')}, - {type: 'button', id: 'insertpage', img: 'insertpage', hidden:true, hint: _('Insert sheet')} + {type: 'button', id: 'insertsheet', img: 'insertsheet', hidden:true, hint: _('Insert sheet')} ], onClick: function (e) { onClick(e.target); @@ -1549,7 +1551,7 @@ map.on('updateparts pagenumberchanged', function (e) { toolbar.show('nextrecord'); toolbar.show('prevrecord'); toolbar.show('lastrecord'); - toolbar.show('insertpage'); + toolbar.show('insertsheet'); } }); @@ -1622,7 +1624,7 @@ map.on('updatepermission', function (e) { } } - var spreadsheetButtons = ['firstrecord', 'prevrecord', 'nextrecord', 'lastrecord', 'insertpage']; + var spreadsheetButtons = ['firstrecord', 'prevrecord', 'nextrecord', 'lastrecord', 'insertsheet']; var formulaBarButtons = ['sum', 'function']; var presentationButtons = ['insertpage', 'duplicatepage', 'deletepage']; var toolbarDownButtons = ['next', 'prev']; |
