Fixed saved scrolling position

This commit is contained in:
Tobias Reich 2014-12-04 22:12:29 +01:00
parent 4a6a86e7c7
commit e6c109269e
2 changed files with 5 additions and 5 deletions

BIN
dist/main.js vendored

Binary file not shown.

View File

@ -175,7 +175,7 @@ view.albums = {
// Restore scroll position
if (view.albums.content.scrollPosition!==null) {
$('html, body').scrollTop(view.albums.content.scrollPosition);
$(document).scrollTop(view.albums.content.scrollPosition);
}
},
@ -269,6 +269,10 @@ view.album = {
var photosData = '';
// Save and reset scroll position
view.albums.content.scrollPosition = $(document).scrollTop();
$('html, body').scrollTop(0);
$.each(album.json.content, function() {
photosData += build.photo(this);
});
@ -276,10 +280,6 @@ view.album = {
$('img[data-type!="svg"]').retina();
/* Save and reset scroll position */
view.albums.content.scrollPosition = $(document).scrollTop();
$('html, body').scrollTop(0);
},
title: function(photoID) {