As far as I can tell, this wasn't working at all.

This commit is contained in:
Zixaphir 2014-01-04 19:51:28 -07:00
parent 3d87a9cfb6
commit c979f44028
3 changed files with 9 additions and 15 deletions

View File

@ -9451,11 +9451,9 @@
posts = Object.keys(Unread.thread.posts); posts = Object.keys(Unread.thread.posts);
root = Unread.thread.posts[posts[posts.length - 1]].nodes.root; root = Unread.thread.posts[posts[posts.length - 1]].nodes.root;
} }
return $.on(window, 'load', function() { if (Header.getBottomOf(root) < 0) {
if (Header.getBottomOf(root) < 0) { return Header.scrollTo(root, down);
return Header.scrollTo(root, down); }
}
});
}, },
sync: function() { sync: function() {
var lastReadPost; var lastReadPost;

View File

@ -9434,11 +9434,9 @@
posts = Object.keys(Unread.thread.posts); posts = Object.keys(Unread.thread.posts);
root = Unread.thread.posts[posts[posts.length - 1]].nodes.root; root = Unread.thread.posts[posts[posts.length - 1]].nodes.root;
} }
return $.on(window, 'load', function() { if (Header.getBottomOf(root) < 0) {
if (Header.getBottomOf(root) < 0) { return Header.scrollTo(root, down);
return Header.scrollTo(root, down); }
}
});
}, },
sync: function() { sync: function() {
var lastReadPost; var lastReadPost;

View File

@ -46,11 +46,9 @@ Unread =
# Scroll to the last read post. # Scroll to the last read post.
posts = Object.keys Unread.thread.posts posts = Object.keys Unread.thread.posts
{root} = Unread.thread.posts[posts[posts.length - 1]].nodes {root} = Unread.thread.posts[posts[posts.length - 1]].nodes
# Prevent the browser to scroll back to
# the previous scroll location on page load. # Scroll to the target unless we scrolled past it.
$.on window, 'load', -> Header.scrollTo root, down if Header.getBottomOf(root) < 0
# Scroll to the target unless we scrolled past it.
Header.scrollTo root, down if Header.getBottomOf(root) < 0
sync: -> sync: ->
lastReadPost = Unread.db.get lastReadPost = Unread.db.get