diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-12-16 14:55:15 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-12-16 16:15:38 +0100 |
commit | f76e4990ed37d798be765129bc74de972da56a0b (patch) | |
tree | 2b9c70b9ae34237f892b4a914b14483aea23bb29 | |
parent | 599919abd08050bf514dbd212fb7f5b3e7dc659e (diff) |
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@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r-- | loleaflet/src/control/Control.JSDialogBuilder.js | 9 | ||||
-rw-r--r-- | loleaflet/src/core/LOUtil.js | 5 |
2 files changed, 6 insertions, 8 deletions
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; } }; |