[Libreoffice-commits] online.git: 5 commits - loleaflet/src
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Wed Oct 16 17:14:39 UTC 2019
loleaflet/src/control/Control.Menubar.js | 52 ++++++++++++++++++-------------
1 file changed, 31 insertions(+), 21 deletions(-)
New commits:
commit 1da5d303071f32f980a68a589357ce699d8069c2
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Oct 16 19:13:43 2019 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Oct 16 19:14:12 2019 +0200
mobile-menu: Make sure requested hidden elements are actually hidden.
Change-Id: I1e45363009afffff05bad78d5643178c9e97e1b0
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 28c1b6107..7f550b041 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1210,7 +1210,11 @@ L.Control.Menubar = L.Control.extend({
if (this._map['wopi'].HideExportOption)
return false;
}
- return true
+
+ if (this._hiddenItems && this._hiddenItems.includes(menuItem.id))
+ return false;
+
+ return true;
},
_createMenu: function(menu) {
commit 6c89ac38221d71ad5fd0e238b92fba6bad54bff9
Author: merttumer <mert.tumer at collabora.com>
AuthorDate: Sun Aug 11 15:56:02 2019 +0300
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Oct 16 19:14:12 2019 +0200
Fixed #4194 fullscreen button visibility conflict
Used hiddenitemlist for menubar to prevent hidden items
from to be shown after reinitialize of the menu
Signed-off-by: merttumer <mert.tumer at collabora.com>
Change-Id: I9e374aba3beab89687394b6b334564db074c3b25
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index eeb098866..28c1b6107 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -623,6 +623,7 @@ L.Control.Menubar = L.Control.extend({
onAdd: function (map) {
this._initialized = false;
+ this._hiddenItems = [];
this._menubarCont = L.DomUtil.get('main-menu');
this._initializeMenu(this.options.initial);
@@ -1264,6 +1265,10 @@ L.Control.Menubar = L.Control.extend({
$(aItem).css('display', 'none');
}
+ if (this._hiddenItems && this._hiddenItems.includes(menu[i].id)) {
+ $(aItem).css('display', 'none');
+ }
+
itemList.push(liItem);
}
@@ -1293,14 +1298,20 @@ L.Control.Menubar = L.Control.extend({
hideItem: function(targetId) {
var item = this._getItem(targetId);
- if (item)
+ if (item) {
+ if (!this._hiddenItems.includes(targetId))
+ this._hiddenItems.push(targetId);
$(item).css('display', 'none');
+ }
},
showItem: function(targetId) {
var item = this._getItem(targetId);
- if (item)
+ if (item) {
+ if (this._hiddenItems.includes(targetId))
+ this._hiddenItems.splice(this._hiddenItems.indexOf(targetId), 1);
$(item).css('display', '');
+ }
},
_initializeMenu: function(menu) {
commit a4c440b45de95ad01e88fc32f8c51d2907fd063e
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Oct 16 19:04:04 2019 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Oct 16 19:14:12 2019 +0200
mobile-menu: impress: Move alone items upper with one level.
We don't need menus with only one item.
Change-Id: Ia325933a44cbfc26436f842e4f12bf7b4b1ed8a5
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 3b957c9e5..eeb098866 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -522,9 +522,6 @@ L.Control.Menubar = L.Control.extend({
{type: 'separator'},
{uno: '.uno:SearchDialog'}
]},
- {name: _UNO('.uno:ViewMenu', 'presentation'), id: 'view', type: 'menu', menu: [
- {name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action', mobileapp: false}
- ]},
{name: _UNO('.uno:TableMenu', 'text'/*HACK should be 'presentation', but not in xcu*/), type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
{uno: '.uno:InsertRowsAfter'},
@@ -538,11 +535,10 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:SlideMenu', 'presentation'), type: 'menu', menu: [
{name: _UNO('.uno:InsertSlide', 'presentation'), id: 'insertpage', type: 'action'},
{name: _UNO('.uno:DuplicateSlide', 'presentation'), id: 'duplicatepage', type: 'action'},
- {name: _UNO('.uno:DeleteSlide', 'presentation'), id: 'deletepage', type: 'action'} ]
- },
- {name: _UNO('.uno:SlideShowMenu', 'presentation'), type: 'menu', menu: [
- {name: _('Fullscreen presentation'), id: 'fullscreen-presentation', type: 'action'}]
+ {name: _UNO('.uno:DeleteSlide', 'presentation'), id: 'deletepage', type: 'action'}]
},
+ {name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action', mobileapp: false},
+ {name: _('Fullscreen presentation'), id: 'fullscreen-presentation', type: 'action'},
{name: _('About'), id: 'about', type: 'action'},
],
commit 9b5007025aa03d3568ed1a907121f4000245745b
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Oct 16 18:55:46 2019 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Oct 16 19:14:12 2019 +0200
mobile-menu: impress: Remove 'Table' menu's sub menus
Move every table operation to one level, to reduce menu levels.
Change-Id: I90b054ff791b6966ea412074b55889826c053568
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 8050778c9..3b957c9e5 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -526,15 +526,13 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action', mobileapp: false}
]},
{name: _UNO('.uno:TableMenu', 'text'/*HACK should be 'presentation', but not in xcu*/), type: 'menu', menu: [
- {name: _UNO('.uno:TableInsertMenu', 'text'/*HACK should be 'presentation', but not in xcu*/), type: 'menu', menu: [
- {uno: '.uno:InsertRowsBefore'},
- {uno: '.uno:InsertRowsAfter'},
- {type: 'separator'},
- {uno: '.uno:InsertColumnsBefore'},
- {uno: '.uno:InsertColumnsAfter'}]},
- {name: _UNO('.uno:TableDeleteMenu', 'text'/*HACK should be 'presentation', but not in xcu*/), type: 'menu', menu: [
- {uno: '.uno:DeleteRows'},
- {uno: '.uno:DeleteColumns'}]},
+ {uno: '.uno:InsertRowsBefore'},
+ {uno: '.uno:InsertRowsAfter'},
+ {type: 'separator'},
+ {uno: '.uno:InsertColumnsBefore'},
+ {uno: '.uno:InsertColumnsAfter'},
+ {uno: '.uno:DeleteRows'},
+ {uno: '.uno:DeleteColumns'},
{uno: '.uno:MergeCells'}]
},
{name: _UNO('.uno:SlideMenu', 'presentation'), type: 'menu', menu: [
commit 763a9dc1b2b68d7a94e2e0167e6655e8832767a0
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Oct 16 18:50:23 2019 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Oct 16 19:14:12 2019 +0200
mobile-menu: Make sure that main-nav element is hidden, second try
Change-Id: I5874d517c9cb7de7672fef10774d02c88ec19776
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 41f475be6..8050778c9 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -782,6 +782,9 @@ L.Control.Menubar = L.Control.extend({
$('#main-menu').bind('keydown', {self: this}, this._onKeyDown);
+ if (L.Browser.mobile)
+ $('#main-menu').parent().css('height', '0');
+
var self = this;
// SmartMenus mobile menu toggle button
$(function() {
@@ -801,7 +804,6 @@ L.Control.Menubar = L.Control.extend({
var menuData = self._map.menubar.generateFullMenuStructure();
self._map.fire('mobilewizard', menuData);
$('#main-menu-btn-icon').css('filter', 'drop-shadow(0px 0px 4px #0b87e7)')
- $nav.css({height:'', bottom: ''});
}
} else if (!L.Browser.mobile) {
$menu.show().slideUp(250, function() { $menu.css('display', ''); });
@@ -810,7 +812,6 @@ L.Control.Menubar = L.Control.extend({
window.mobileMenuWizard = false;
self._map.fire('closemobilewizard');
$('#main-menu-btn-icon').css('filter', '')
- $nav.css({height:'', bottom: ''});
}
});
// hide mobile menu beforeunload
More information about the Libreoffice-commits
mailing list