Fix FancyBox in the list view of Explorer
This commit is contained in:
parent
5da19afed3
commit
e5d4f26fc2
@ -447,7 +447,7 @@ jQuery(document).ready(function($)
|
||||
else
|
||||
result += '<td> </td>'
|
||||
|
||||
result += '<td><a data-fancybox="exposition-list" href="';
|
||||
result += '<td><a class="list-preview" data-fancybox="exposition-list" href="';
|
||||
if (i.photo == "none")
|
||||
result += 'images/unknown.jpg';
|
||||
else
|
||||
|
@ -1,6 +1,6 @@
|
||||
function fancyboxInit(data, explorer)
|
||||
{
|
||||
$('[data-fancybox="exposition"], [data-fancybox="exposition-list"]').fancybox(
|
||||
$('[data-fancybox="exposition"]').fancybox(
|
||||
{
|
||||
selector: '.gallery a',
|
||||
infobar: false,
|
||||
@ -14,7 +14,31 @@ function fancyboxInit(data, explorer)
|
||||
preventCaptionOverlap: true,
|
||||
},
|
||||
|
||||
caption: function(instance, item)
|
||||
caption: function(instance, item) { return caption(item, data); },
|
||||
beforeShow : function(instance, current) { return beforeShow(instance, current); },
|
||||
afterClose : function(instance) { return afterClose(instance); }
|
||||
});
|
||||
|
||||
$('[data-fancybox="exposition-list"]').fancybox(
|
||||
{
|
||||
selector: 'a.list-preview',
|
||||
infobar: false,
|
||||
toolbar: true,
|
||||
smallBtn: false,
|
||||
buttons: ["arrowLeft", "arrowRight", "close"],
|
||||
arrows: false,
|
||||
transitionEffect: "fade",
|
||||
baseClass: 'fancybox-custom-layout',
|
||||
mobile: {
|
||||
preventCaptionOverlap: true,
|
||||
},
|
||||
|
||||
caption: function(instance, item) { return caption(item, data); },
|
||||
beforeShow : function(instance, current) { return beforeShow(instance, current); },
|
||||
afterClose : function(instance) { return afterClose(instance); }
|
||||
});
|
||||
|
||||
function caption(item, data)
|
||||
{
|
||||
var idx = 0; // search the index of the painting of filtered data
|
||||
for (i = 0; i < data.length; i++)
|
||||
@ -39,22 +63,23 @@ function fancyboxInit(data, explorer)
|
||||
if (data[idx].comment != '—')
|
||||
cartel += '<span class="comment">' + data[idx].comment + '</span>';
|
||||
cartel += '</div>';
|
||||
|
||||
return cartel;
|
||||
}
|
||||
|
||||
return generateCartel();
|
||||
},
|
||||
}
|
||||
|
||||
beforeShow : function(instance, current)
|
||||
function beforeShow(instance, current)
|
||||
{
|
||||
if (current.opts.fancyboxIndex > previousArray[previousArray.length - 1])
|
||||
$('#pagination').pagination('next');
|
||||
|
||||
if (current.opts.fancyboxIndex < previousArray[0])
|
||||
$('#pagination').pagination('previous');
|
||||
},
|
||||
}
|
||||
|
||||
afterClose : function(instance)
|
||||
function afterClose(instance)
|
||||
{
|
||||
// after closing, changing the URL again. I guess there's no better way except by changing fancybox code...
|
||||
// (apparently fancybox changes back to the original url it had when starting)
|
||||
@ -67,5 +92,5 @@ function fancyboxInit(data, explorer)
|
||||
else
|
||||
window.history.replaceState('', '', window.location.pathname + '?page=' + currentPage + window.location.hash);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user