[Libreoffice-commits] online.git: 2 commits - loleaflet/src
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Mon Dec 16 15:15:56 UTC 2019
loleaflet/src/control/Control.JSDialogBuilder.js | 11 +++--------
loleaflet/src/core/LOUtil.js | 5 ++++-
2 files changed, 7 insertions(+), 9 deletions(-)
New commits:
commit 4f7958dcc101a0d70fa0ea244f21a05e58e7ec2e
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Dec 16 15:03:26 2019 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Dec 16 16:15:42 2019 +0100
Revert "This is not needed anymore."
This reverts commit a184b2b812405a55a63bf7d5718963f519fb3c95.
Change-Id: I5373831dc6e02de255d8c439ba99118873c07c28
Reviewed-on: https://gerrit.libreoffice.org/85225
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.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 4b993e790..f031a13d8 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1415,7 +1415,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
var icon = null;
var commandName = data.command ? data.command.substring('.uno:'.length) : data.id;
- if (commandName && commandName.length) {
+ if (commandName && commandName.length && L.LOUtil.existsIconForCommand(commandName)) {
var iconSpan = L.DomUtil.create('span', 'menu-entry-icon ' + commandName.toLowerCase(), menuEntry);
var iconPath = 'images/lc_' + commandName.toLowerCase() + '.svg';
icon = L.DomUtil.create('img', '', iconSpan);
commit f76e4990ed37d798be765129bc74de972da56a0b
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Dec 16 14:55:15 2019 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Dec 16 16:15:38 2019 +0100
Revert "Context menus: Better to handle missing icon automatically."
This reverts commit fb12f822699274c9c1d8a249d199ecc892070938.
With this method the "missing image" icon is displayed for a moment,
before removing it from the screen.
Change-Id: I360279244bccddb23eadca485e571d6ac514d865
Reviewed-on: https://gerrit.libreoffice.org/85224
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.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 9145f2bcb..4b993e790 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1420,20 +1420,15 @@ 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) {
L.DomUtil.addClass(menuEntry, 'menu-entry-checked');
}
var titleSpan = L.DomUtil.create('span', '', menuEntry);
titleSpan.innerHTML = title;
- L.DomUtil.addClass(titleSpan, 'menu-entry-with-icon');
+ var paddingClass = icon ? 'menu-entry-with-icon' : 'menu-entry-no-icon';
+ L.DomUtil.addClass(titleSpan, paddingClass);
if (builder.wizard) {
$(menuEntry).click(function() {
diff --git a/loleaflet/src/core/LOUtil.js b/loleaflet/src/core/LOUtil.js
index 0172c1058..95252882d 100644
--- a/loleaflet/src/core/LOUtil.js
+++ b/loleaflet/src/core/LOUtil.js
@@ -97,7 +97,8 @@ L.LOUtil = {
'InsertZWSP',
'InsertZWNBSP',
'InsertLRM',
- 'InsertRLM'
+ 'InsertRLM',
+ 'None'
],
existsIconForCommand: function(command) {
@@ -105,6 +106,8 @@ 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