loleaflet/css/loleaflet.css | 6 ++++ loleaflet/css/menubar.css | 9 +++---- loleaflet/html/loleaflet.html.m4 | 3 -- loleaflet/src/control/Control.Menubar.js | 39 ++++++++++++++++++++++--------- 4 files changed, 39 insertions(+), 18 deletions(-)
New commits: commit c01f0a0f596960e6538a7fbbc7d755c6d5d43a85 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Mar 12 16:40:55 2019 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Wed Mar 13 16:41:13 2019 +0100 Don't wrap menubar Change-Id: I704c59c2ee6ac1dea61b98ecb1e82db63c84a96a Reviewed-on: https://gerrit.libreoffice.org/69156 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css index b79b56a53..c9a590215 100644 --- a/loleaflet/css/loleaflet.css +++ b/loleaflet/css/loleaflet.css @@ -105,6 +105,12 @@ body { background: url('images/baseline-edit-24px.svg') no-repeat center !important; } +@media (max-width: 900px),(max-device-height: 900px) { + #menu-last-mod { + display: none; + } +} + @media (max-width: 767px),(max-device-height: 767px) { /* Show slidesorter beyond 768px only */ #presentation-controls-wrapper { diff --git a/loleaflet/css/menubar.css b/loleaflet/css/menubar.css index f8ec2e3ba..099210f9c 100644 --- a/loleaflet/css/menubar.css +++ b/loleaflet/css/menubar.css @@ -6,6 +6,8 @@ float: left; background-color: transparent; margin-left: 5px; + white-space: nowrap; + display: inline; } #main-menu.readonly { @@ -15,11 +17,10 @@ #document-header { position: relative; background: #ffffff; - margin-left: 5px; - float: left; + margin-right: 5px; } -#document-logo { +.document-logo { position: relative; width: 22px; height: 30px; @@ -256,7 +257,7 @@ } @media (max-width: 767px),(max-device-height: 767px) { - #document-logo { + .document-logo { width: 35px; height: 38px; } diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4 index f68ac940d..736dd26a9 100644 --- a/loleaflet/html/loleaflet.html.m4 +++ b/loleaflet/html/loleaflet.html.m4 @@ -82,9 +82,6 @@ ifelse(MOBILEAPP,[true], cause the content to overflow, creating scrollbars --> <nav class="main-nav" role="navigation"> - <div id="document-header"> - <div id="document-logo" class="document-logo"></div> - </div> <!-- Mobile menu toggle button (hamburger/x icon) --> <input id="main-menu-state" type="checkbox" style="display: none"/> <ul id="main-menu" class="sm sm-simple lo-menu readonly"></ul> diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index be6148a6c..1ba848f07 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -538,6 +538,10 @@ L.Control.Menubar = L.Control.extend({ subIndicatorsText: '›' }); $('#main-menu').attr('tabindex', 0); + + if (this._map._permission !== 'readonly') { + this._createFileIcon(); + } }, _onStyleMenu: function (e) { @@ -566,17 +570,6 @@ L.Control.Menubar = L.Control.extend({ _onDocLayerInit: function() { this._onRefresh(); - var docType = this._map.getDocType(); - var $docLogo = $('#document-logo'); - $docLogo.bind('click', {self: this}, this._createDocument); - if (docType === 'text') { - $docLogo.addClass('writer-icon-img'); - } else if (docType === 'spreadsheet') { - $docLogo.addClass('calc-icon-img'); - } else if (docType === 'presentation' || docType === 'drawing') { - $docLogo.addClass('impress-icon-img'); - } - $('#main-menu').bind('select.smapi', {self: this}, this._onItemSelected); $('#main-menu').bind('mouseenter.smapi', {self: this}, this._onMouseEnter); $('#main-menu').bind('mouseleave.smapi', {self: this}, this._onMouseLeave); @@ -838,6 +831,30 @@ L.Control.Menubar = L.Control.extend({ } }, + _createFileIcon: function() { + var iconClass = 'document-logo'; + var docType = this._map.getDocType(); + if (docType === 'text') { + iconClass += ' writer-icon-img'; + } else if (docType === 'spreadsheet') { + iconClass += ' calc-icon-img'; + } else if (docType === 'presentation' || docType === 'drawing') { + iconClass += ' impress-icon-img'; + } + + var liItem = L.DomUtil.create('li', ''); + liItem.id = 'document-header'; + var aItem = L.DomUtil.create('div', iconClass, liItem); + $(aItem).data('id', 'document-logo'); + $(aItem).data('type', 'action'); + + this._menubarCont.insertBefore(liItem, this._menubarCont.firstChild); + + var $docLogo = $(aItem); + $docLogo.bind('click', {self: this}, this._createDocument); + + }, + _createMenu: function(menu) { var itemList = []; var docType = this._map.getDocType(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits