This commit is contained in:
16
static/scripts/main.js
Normal file
16
static/scripts/main.js
Normal file
@@ -0,0 +1,16 @@
|
||||
$(document).ready(function() {
|
||||
$("[data-lightbox]").fancybox({
|
||||
loop: false,
|
||||
caption: function(instance, item) {
|
||||
const img = this.querySelector('img');
|
||||
let caption = img.getAttribute('alt') ?? '';
|
||||
|
||||
if (item.type === 'image') {
|
||||
const download = this.getAttribute('data-original') ?? item.src;
|
||||
caption = (caption.length ? caption + '<br />' : '') + '<a href="' + download + '">Stáhnout obrázek</a>' ;
|
||||
}
|
||||
|
||||
return caption;
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user