Improved image and thumbnail loading

This commit is contained in:
Marcin Kurczewski
2014-10-05 11:05:34 +02:00
parent 784ff22050
commit b57fee0ad8
15 changed files with 28 additions and 17 deletions

View File

@ -24,6 +24,13 @@ App.Util = function(_, jQuery, promise) {
return exitConfirmationEnabled;
}
function loadImagesNicely($img) {
$img.css('opacity', '0');
$img.bind('load', function() {
$img.animate({opacity: 1}, 'fast');
});
}
function parseComplexRouteArgs(args) {
var result = {};
args = (args || '').split(/;/);
@ -189,6 +196,7 @@ App.Util = function(_, jQuery, promise) {
disableExitConfirmation: disableExitConfirmation,
isExitConfirmationEnabled: isExitConfirmationEnabled,
transparentPixel: transparentPixel,
loadImagesNicely: loadImagesNicely,
};
};