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

1
TODO
View file

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

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