Fixed images used fadein even if loaded from cache

This commit is contained in:
Marcin Kurczewski
2014-10-18 15:40:01 +02:00
parent 1610659910
commit c6be637d53
2 changed files with 6 additions and 5 deletions

View File

@ -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) {