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
-
... ... @@ -11,7 +11,7 @@ 11 11 //pokud ma img alt, pak ho nastavime jako title lightboxu 12 12 var img_src = $(this).attr('src'); 13 13 var img_alt = $(this).attr('alt'); 14 - if (img_alt && !img_src.includes(img_alt)) { 14 + if (img_alt && !(img_src.includes(img_alt))) { 15 15 $(this).parents("a").attr("data-title", img_alt); 16 16 } 17 17 //fig and figcaption handling ... ... @@ -20,10 +20,10 @@ 20 20 'class': 'image' 21 21 })); 22 22 23 - 24 - if (img_alt and!img_src.includes(img_alt))25 - 26 - 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 + } 27 27 } 28 28 }); //each function 29 29 }); //dom updated