loleaflet/css/notebookbar.css | 21 +++++++++------------ loleaflet/src/control/Control.Notebookbar.js | 13 ++++++++----- loleaflet/src/control/Control.UIManager.js | 13 +++++++++---- 3 files changed, 26 insertions(+), 21 deletions(-)
New commits: commit fb53f39fa81b90f4850504dcab5f8030ab3bb5ad Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Apr 29 08:15:34 2020 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri May 1 18:29:13 2020 +0200 notebookbar: correctly positioned in all apps Change-Id: I33d467954f0da5b1ca0451287ff0e6911f3d6b50 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93289 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css index 3d0ec5c4b..4cf5403bb 100644 --- a/loleaflet/css/notebookbar.css +++ b/loleaflet/css/notebookbar.css @@ -29,23 +29,20 @@ /* root container */ -.notebookbar-scroll-wrapper ~ .w2ui-scroll-left, .notebookbar-scroll-wrapper ~ .w2ui-scroll-right { - position: fixed; - top: 37px; -} - .notebookbar-scroll-wrapper { - position: fixed; - left: 0px; - right: 0px; - top: 40px; - overflow-x: scroll; + overflow-y: hidden; + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* Internet Explorer 10+ */ + height: 105px; margin-top: -25px; + padding-top: 5px; +} - /* be sure no scrollbar is visible on the bottom */ - min-height: 130px; +.notebookbar-scroll-wrapper::-webkit-scrollbar { /* WebKit */ + width: 0; + height: 0; } /* unobuttons */ diff --git a/loleaflet/src/control/Control.Notebookbar.js b/loleaflet/src/control/Control.Notebookbar.js index 90a077692..087823cce 100644 --- a/loleaflet/src/control/Control.Notebookbar.js +++ b/loleaflet/src/control/Control.Notebookbar.js @@ -29,7 +29,7 @@ L.Control.Notebookbar = L.Control.extend({ tabJSON = JSON.parse(tabJSON); var builder = new L.control.notebookbarBuilder({mobileWizard: this, map: this.map, cssClass: 'notebookbar'}); - var parent = $('#toolbar-wrapper').get(0); + var parent = $('#toolbar-up').get(0); var container = L.DomUtil.create('div', 'notebookbar-scroll-wrapper', parent); builder.build(container, [tabJSON]); @@ -68,7 +68,7 @@ L.Control.Notebookbar = L.Control.extend({ setCurrentScrollPosition: function() {}, createScrollButtons: function() { - var parent = $('#toolbar-wrapper').get(0); + var parent = $('#toolbar-up').get(0); var left = L.DomUtil.create('div', 'w2ui-scroll-left', parent); var right = L.DomUtil.create('div', 'w2ui-scroll-right', parent); @@ -90,8 +90,8 @@ L.Control.Notebookbar = L.Control.extend({ }, setupResizeHandler: function() { - $(window).resize(function() { - var container = $('#toolbar-wrapper').get(0); + var handler = function() { + var container = $('#toolbar-up').get(0); var rootContainer = $('.notebookbar-scroll-wrapper table').get(0); if ($(rootContainer).outerWidth() > $(window).width()) { @@ -109,7 +109,10 @@ L.Control.Notebookbar = L.Control.extend({ $(container).find('.w2ui-scroll-left').hide(); $(container).find('.w2ui-scroll-right').hide(); } - }); + }; + + $(window).resize(handler); + $('.notebookbar-scroll-wrapper').scroll(handler); }, getHomeTab: function() { diff --git a/loleaflet/src/control/Control.UIManager.js b/loleaflet/src/control/Control.UIManager.js index 417fc0fc9..6070ae26c 100644 --- a/loleaflet/src/control/Control.UIManager.js +++ b/loleaflet/src/control/Control.UIManager.js @@ -68,10 +68,15 @@ L.Control.UIManager = L.Control.extend({ } else if (window.enableNotebookbar) { this.map.addControl(L.control.notebookbar({docType: docType})); - this.moveObjectVertically($('#spreadsheet-row-column-frame'), 40); - this.moveObjectVertically($('#document-container'), 81); - this.moveObjectVertically($('#presentation-controls-wrapper'), 40); - this.moveObjectVertically($('#sidebar-dock-wrapper'), 40); + var additionalOffset = 0; + if (docType === 'spreadsheet') { + additionalOffset = 56; + } + + this.moveObjectVertically($('#spreadsheet-row-column-frame'), 121); + this.moveObjectVertically($('#document-container'), 84 + additionalOffset); + this.moveObjectVertically($('#presentation-controls-wrapper'), 84); + this.moveObjectVertically($('#sidebar-dock-wrapper'), 43); } if (docType === 'spreadsheet') { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits