From 2802ee233ca764691854fa3317c7dc1d0677c4ae Mon Sep 17 00:00:00 2001 From: Michael Price Date: Mon, 12 Mar 2018 18:31:42 -0400 Subject: [PATCH] Close fancybox when clicking on the caption of a preview to move to the document view. Signed-off-by: Michael Price Signed-off-by: Roberto Rosario --- docs/topics/code_statistics.rst | 3 +-- docs/topics/pending_work.rst | 1 - .../apps/appearance/static/appearance/js/mayan_image.js | 9 ++++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/topics/code_statistics.rst b/docs/topics/code_statistics.rst index f8115bf911..6130ee7f26 100644 --- a/docs/topics/code_statistics.rst +++ b/docs/topics/code_statistics.rst @@ -1,6 +1,5 @@ -=============== Code statistics -=============== +--------------- As of Sun Mar 4 00:43:25 2018 (commit d367d32be62ed86dd6d7b02658eac2fa8086dbb9) diff --git a/docs/topics/pending_work.rst b/docs/topics/pending_work.rst index 5cdd1eb95c..99eb2c2dc0 100644 --- a/docs/topics/pending_work.rst +++ b/docs/topics/pending_work.rst @@ -9,7 +9,6 @@ These are errors or issues that are blocking a release. UI - Frontend ~~~~~~~~~~~~~ -- Close fancybox when clicking on the title to move to the document view. - Match row height is not executing until scroll. - Fix shift+click and control+click. diff --git a/mayan/apps/appearance/static/appearance/js/mayan_image.js b/mayan/apps/appearance/static/appearance/js/mayan_image.js index 72c5527fe1..23f123d232 100644 --- a/mayan/apps/appearance/static/appearance/js/mayan_image.js +++ b/mayan/apps/appearance/static/appearance/js/mayan_image.js @@ -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)}); },