[Libreoffice-commits] online.git: loleaflet/src
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jan 25 11:30:05 UTC 2020
loleaflet/src/control/Control.JSDialogBuilder.js | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit dd48efc7ca5417a8fe4e4606b75764cc9a8a2c03
Author: Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Sat Jan 25 14:52:11 2020 +0530
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jan 25 12:29:45 2020 +0100
[MobileWizard] Do not display broken-image icon in firefox
In the mobile wizard, if there are no icons for a menu entry, firefox
will display a broken image even if we set alt='' in img tag. Lets add
an error event handler for img(icon) element to not display
anything. This seems to be the general solution that works both in Chrome
and Firefox.
TODO: We may want a css-only solution probably by having a custom transparent
icon to override the broken-image icon.
Change-Id: I879035ca847c4c52611eccfc20834866c0144e02
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87373
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index e5c48f53e..3660dc2fa 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1429,6 +1429,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
icon = L.DomUtil.create('img', '', iconSpan);
icon.src = iconPath;
icon.alt = '';
+ icon.addEventListener('error', function() {
+ icon.style.display = 'none';
+ });
}
if (data.checked && data.checked === true) {
L.DomUtil.addClass(menuEntry, 'menu-entry-checked');
More information about the Libreoffice-commits
mailing list