Space key fix from pull request #25.

This commit is contained in:
Alexey Skobkin 2015-01-27 04:02:48 +03:00
parent aa7b9649d1
commit 3e6e3d5855
1 changed files with 3 additions and 5 deletions

View File

@ -1089,14 +1089,12 @@ function set_space_key_skip_handler() {
} }
function space_key_event() { function space_key_event() {
var scroll_current = $('body').scrollTop(); var scroll_current = Math.floor($('body').scrollTop());
var scroll_step_size = 0;
var scroll_real = Math.max(scroll_current - scroll_step_size, 0);
var posts = $('.content-wrap > .post'); var posts = $('.content-wrap > .post');
for (var i = 0; i < posts.length; i++) { for (var i = 0; i < posts.length; i++) {
var this_top_px = $(posts[i]).offset().top; var this_top_px = Math.floor($(posts[i]).offset().top);
if (this_top_px > scroll_real) { if (this_top_px > scroll_current) {
$('body').animate({ $('body').animate({
'scrollTop': this_top_px 'scrollTop': this_top_px
}, 200); }, 200);