Close fancybox when clicking on the caption of a preview to move to the document view.

Signed-off-by: Michael Price <loneviking72@gmail.com>
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Michael Price
2018-04-01 20:13:59 -04:00
committed by Roberto Rosario
parent d03c6b4646
commit 2802ee233c
3 changed files with 9 additions and 4 deletions
@@ -6,6 +6,8 @@ var MayanImage = function (options) {
}
MayanImage.intialize = function () {
var app = this;
this.fancybox = $().fancybox({
animationDuration : 400,
buttons : [
@@ -13,9 +15,14 @@ MayanImage.intialize = function () {
'close'
],
selector: 'a.fancybox',
afterShow: function (instance, current) {
$('a.a-caption').on('click', function(event) {
instance.close(true);
});
},
});
$('img.lazy-load').lazyload({
$('img.lazy-load').lazyload({
appear: function(elements_left, settings) {
new MayanImage({element: $(this)});
},