loleaflet/src/control/Control.JSDialogBuilder.js |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit dd48efc7ca5417a8fe4e4606b75764cc9a8a2c03
Author:     Dennis Francis <dennis.fran...@collabora.com>
AuthorDate: Sat Jan 25 14:52:11 2020 +0530
Commit:     Michael Meeks <michael.me...@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 <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Michael Meeks <michael.me...@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');
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to