better logic for space scrolling

This commit is contained in:
albert
2013-03-08 16:11:31 -05:00
parent 9af2826098
commit 86b87e0173

View File

@@ -79,14 +79,10 @@
Danbooru.Post.nav_pool_scroll = function() {
var scroll_top = $(window).scrollTop() + $(window).height();
if (scroll_top > $("#image").height() + $("#image").offset().top + $(window).height()) {
if (scroll_top > $("#image").height() + $("#image").offset().top + ($("#image").height() / 2)) {
Danbooru.Post.nav_pool_next();
return;
}
$('html, body').animate({
scrollTop: scroll_top
}, 250);
}
Danbooru.Post.initialize_shortcuts = function() {
@@ -114,7 +110,6 @@
$(document).bind("keydown.space", function(e) {
Danbooru.Post.nav_pool_scroll();
e.preventDefault();
})
}
}