Browse Source

Fixed saved scrolling position

Tobias Reich 9 years ago
parent
commit
e6c109269e
2 changed files with 5 additions and 5 deletions
  1. 0 0
      dist/main.js
  2. 5 5
      src/scripts/view.js

File diff suppressed because it is too large
+ 0 - 0
dist/main.js


+ 5 - 5
src/scripts/view.js

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

Some files were not shown because too many files changed in this diff