[Libreoffice-commits] online.git: 3 commits - loleaflet/css loleaflet/src

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 6 17:15:52 UTC 2019


 loleaflet/css/toolbar.css                        |    4 +++
 loleaflet/src/control/Control.ContextMenu.js     |   27 ++++++++++++++---------
 loleaflet/src/control/Control.JSDialogBuilder.js |   11 ++++++---
 loleaflet/src/core/LOUtil.js                     |    5 ----
 4 files changed, 30 insertions(+), 17 deletions(-)

New commits:
commit b36d56bf5b022bf4b41d062a82326b5ea57b8dbf
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Dec 6 15:46:09 2019 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Dec 6 18:15:46 2019 +0100

    Context menu wizard: wait a small time before showing context menu.
    
    Otherwise a cursor invalidation can close the wizard just after
    it is opened.
    
    Change-Id: I3e153ca05a0902b9b2225bbb6169062b79eebdd0
    Reviewed-on: https://gerrit.libreoffice.org/84648
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js
index 30f539493..6109a7171 100644
--- a/loleaflet/src/control/Control.ContextMenu.js
+++ b/loleaflet/src/control/Control.ContextMenu.js
@@ -3,7 +3,7 @@
 * Control.ContextMenu
 */
 
-/* global $ _ _UNO */
+/* global $ _ _UNO vex */
 L.Control.ContextMenu = L.Control.extend({
 	options: {
 		SEPARATOR: '---------',
@@ -101,20 +101,27 @@ L.Control.ContextMenu = L.Control.extend({
 		if (this.hasContextMenu) {
 			this._onClosePopup();
 		}
+
 		var contextMenu = this._createContextMenuStructure(obj);
+		var spellingContextMenu = false;
+		for (var menuItem in contextMenu) {
+			if (menuItem.includes('.uno:SpellCheckIgnore')) {
+				spellingContextMenu = true;
+				break;
+			}
+		}
 		if (window.mode.isMobile()) {
 			window.contextMenuWizard = true;
 			var menuData = this.getMenuStructureForMobileWizard(contextMenu, true, '');
-			map.fire('mobilewizard', menuData);
-		} else {
-			var spellingContextMenu = false;
-			for (var menuItem in contextMenu) {
-				if (menuItem.includes('.uno:SpellCheckIgnore')) {
-					spellingContextMenu = true;
-					break;
-				}
+			if (spellingContextMenu === true) {
+				vex.timer = setInterval(function() {
+					map.fire('mobilewizard', menuData);
+					clearTimeout(vex.timer);
+				}, 200);
+			} else {
+				map.fire('mobilewizard', menuData);
 			}
-
+		} else {
 			L.installContextMenu({
 				selector: '.leaflet-layer',
 				className: 'loleaflet-font',
commit 05f6b9cabed4e83d24bbe2aadc9483a8ef903e60
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Dec 6 15:27:18 2019 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Dec 6 18:15:41 2019 +0100

    Menu wizard: move checked style to css.
    
    Change-Id: I090cbee4b57276c6722772a72515a1cd69cdef5f
    Reviewed-on: https://gerrit.libreoffice.org/84647
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index d7ac66281..790319b37 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -820,6 +820,10 @@ tr.useritem > td > img {
 	background: transparent;
 }
 
+.menu-entry-checked {
+	background: url(images/lc_listitem-selected.svg) no-repeat right;
+}
+
 .menu-entry-with-icon {
 	padding-left: 10px;
 }
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 4a8a84e3c..936b1480d 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1412,7 +1412,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		}
 
 		if (data.checked && data.checked === true) {
-			$(menuEntry).css('background', 'url(images/lc_listitem-selected.svg) no-repeat right');
+			L.DomUtil.addClass(menuEntry, 'menu-entry-checked');
 		}
 
 		var titleSpan = L.DomUtil.create('span', '', menuEntry);
commit fb12f822699274c9c1d8a249d199ecc892070938
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Dec 6 15:19:01 2019 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Fri Dec 6 18:15:34 2019 +0100

    Context menus: Better to handle missing icon automatically.
    
    When image can not be loaded we remove the icon span and
    change the titleSpan's class to the non icon one.
    Removed existsIconForCommand's parts which are added for
    conext menus.
    
    Change-Id: I4c3130646b30aab06fb07415c08eea828eadf8db
    Reviewed-on: https://gerrit.libreoffice.org/84646
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 2c4183a13..4a8a84e3c 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1404,15 +1404,20 @@ L.Control.JSDialogBuilder = L.Control.extend({
 			var iconPath = 'images/lc_' + commandName.toLowerCase() + '.svg';
 			icon = L.DomUtil.create('img', '', iconSpan);
 			icon.src = iconPath;
+			icon.onerror = function() {
+				L.DomUtil.removeClass(iconSpan.nextSibling, 'menu-entry-with-icon');
+				L.DomUtil.addClass(iconSpan.nextSibling, 'menu-entry-no-icon');
+				L.DomUtil.remove(iconSpan);
+			}
 		}
+
 		if (data.checked && data.checked === true) {
 			$(menuEntry).css('background', 'url(images/lc_listitem-selected.svg) no-repeat right');
 		}
 
 		var titleSpan = L.DomUtil.create('span', '', menuEntry);
 		titleSpan.innerHTML = title;
-		var paddingClass = icon ? 'menu-entry-with-icon' : 'menu-entry-no-icon';
-		L.DomUtil.addClass(titleSpan, paddingClass);
+		L.DomUtil.addClass(titleSpan, 'menu-entry-with-icon');
 
 		if (builder.wizard) {
 			$(menuEntry).click(function() {
diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js
index 95252882d..0172c1058 100644
--- a/loleaflet/src/core/LOUtil.js
+++ b/loleaflet/src/core/LOUtil.js
@@ -97,8 +97,7 @@ L.LOUtil = {
 		'InsertZWSP',
 		'InsertZWNBSP',
 		'InsertLRM',
-		'InsertRLM',
-		'None'
+		'InsertRLM'
 	],
 
 	existsIconForCommand: function(command) {
@@ -106,8 +105,6 @@ L.LOUtil = {
 		var res = !this.commandWithoutIcon.find(function (el) {
 			return el.startsWith(commandName);
 		});
-		if (commandName.indexOf('?')!== -1)
-			return false;
 		return res;
 	}
 };


More information about the Libreoffice-commits mailing list