Merge branch 'v3'

Conflicts:
	builds/appchan-x.user.js
	builds/crx/script.js
This commit is contained in:
Zixaphir 2014-01-04 19:52:34 -07:00
commit 9408053741
3 changed files with 9 additions and 15 deletions

View File

@ -11756,11 +11756,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

@ -11740,11 +11740,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