From c6be637d53d5c4a616ee7b8eb39a77a910444b89 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 18 Oct 2014 15:40:01 +0200 Subject: [PATCH] Fixed images used fadein even if loaded from cache --- TODO | 1 - public_html/js/Util.js | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index abb6f58c..5c7f148c 100644 --- a/TODO +++ b/TODO @@ -16,7 +16,6 @@ first major release. http://svn.apache.org/repos/asf/httpd/httpd/trunk/README - misc: add spinner to forms such as registration, login, settings... - misc: improve throbber appearance -- misc: try not to fade in images that are already in browser cache - post notes - "add note" in sidebar creates new note in the middle of image diff --git a/public_html/js/Util.js b/public_html/js/Util.js index 3f2ed4fd..ccdf1f77 100644 --- a/public_html/js/Util.js +++ b/public_html/js/Util.js @@ -25,10 +25,12 @@ App.Util = function(_, jQuery, marked, promise) { } function loadImagesNicely($img) { - $img.css('opacity', '0'); - $img.bind('load', function() { - $img.animate({opacity: 1}, 'fast'); - }); + if (!$img.get(0).complete) { + $img.css('opacity', '0'); + $img.bind('load', function() { + $img.animate({opacity: 1}, 'fast'); + }); + } } function promiseTemplate(templateName) {