Revert "Context menus: Better to handle missing icon automatically."
This reverts commit fb12f82269
.
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>
This commit is contained in:
parent
599919abd0
commit
f76e4990ed
2 changed files with 6 additions and 8 deletions
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue