From 84e78f16d9e7e381147923f2c8aed3f887cf37a9 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 12 Dec 2018 23:14:43 -0400 Subject: [PATCH] Appearance: Remove fadeIn animation Remove the fade in animation in document thumbnails. Tweak the match height refresh interval to reduce scrollbar jitter in Firefox. Change the fancybox display animation from zoom to fade in. Signed-off-by: Roberto Rosario --- .../static/appearance/js/mayan_image.js | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/mayan/apps/appearance/static/appearance/js/mayan_image.js b/mayan/apps/appearance/static/appearance/js/mayan_image.js index 63b26fc0c0..4c00eb5d44 100644 --- a/mayan/apps/appearance/static/appearance/js/mayan_image.js +++ b/mayan/apps/appearance/static/appearance/js/mayan_image.js @@ -11,19 +11,19 @@ class MayanImage { this.options.templateInvalidDocument = this.options.templateInvalidDocument || 'Error loading document image'; $().fancybox({ - animationDuration : 300, - buttons : [ - 'fullScreen', - 'close', - ], - selector: 'a.fancybox', afterShow: function (instance, current) { $('a.a-caption').on('click', function(event) { instance.close(true); }); }, + animationEffect: 'fade', + animationDuration: 100, + buttons : [ + 'fullScreen', + 'close', + ], infobar: true, - + selector: 'a.fancybox', }); $('img.lazy-load').lazyload({ @@ -43,16 +43,16 @@ class MayanImage { $('.lazy-load').one('load', function() { $(this).hide(); - $(this).fadeIn(200); + $(this).show(); $(this).siblings('.spinner-container').remove(); $(this).removeClass('lazy-load pull-left'); clearTimeout(MayanImage.timer); - MayanImage.timer = setTimeout(MayanImage.timerFunction, 100); + MayanImage.timer = setTimeout(MayanImage.timerFunction, 250); }); $('.lazy-load-carousel').one('load', function() { $(this).hide(); - $(this).fadeIn(200); + $(this).show(); $(this).siblings('.spinner-container').remove(); $(this).removeClass('lazy-load-carousel pull-left'); }); @@ -73,14 +73,16 @@ class MayanImage { this.element.attr('src', dataURL); setTimeout(function () { self.element.on('error', function () { - // Check the .complete property to see if it is a real error - // or it was a cached image + // Check the .complete property to see if it is a real + // error or it was a cached image if (this.complete === false) { - // It is a cached image, set the src attribute to trigger - // it's display. + // It is a cached image, set the src attribute to + // trigger it's display. this.src = dataURL; } else { - container.html(MayanImage.options.templateInvalidDocument); + container.html( + MayanImage.options.templateInvalidDocument + ); } }); }, 1);