Změny dokumentu Lightbox support
Naposledy upravil David Brazda 08.04.2021 15:19
Popis verze:
allow view právo pro XWiki.Reader
Přehled
-
Objects (1 změněno, 0 přidáno, 0 odstraněno)
Rozpis
- XWiki.JavaScriptExtension[1]
-
- Kód
-
... ... @@ -9,9 +9,8 @@ 9 9 //nastavime lightbox 10 10 $(this).parents("a").attr("data-lightbox","lightbox"); 11 11 //pokud ma img alt, pak ho nastavime jako title lightboxu 12 - var img_src = $(this).attr('src'); 13 13 var img_alt = $(this).attr('alt'); 14 - if (img_alt && !(img_src.includes(img_alt))){13 + if (img_alt) { 15 15 $(this).parents("a").attr("data-title", img_alt); 16 16 } 17 17 //fig and figcaption handling ... ... @@ -19,11 +19,9 @@ 19 19 jQuery(this).wrap($('<figure/>', { 20 20 'class': 'image' 21 21 })); 22 - 23 - //pokud neni alt vyplneny a nebo je alt stejný jako název souboru - pak caption nezobrazuj 24 - if (img_alt && !(img_src.includes(img_alt))) { 25 - $(this).after($('<figcaption/>').append(img_alt)); 26 - } 21 + if (img_alt) { 22 + $(this).after($('<figcaption/>').append(img_alt)); 23 + } 27 27 } 28 28 }); //each function 29 29 }); //dom updated