From f93e46cbe6b52fd14e645a9aab223ecbf1b8d777 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 30 Apr 2011 06:08:00 -0700 Subject: [PATCH] fix #50 --- 4chan_x.js | 6 ++++-- script.coffee | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 3778d71c7..7dc8b8996 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -838,8 +838,10 @@ } if (delta === +1) { if (i === nav.threads.length || (innerHeight + pageYOffset === d.body.scrollHeight)) { - window.location = "" + (g.PAGENUM + 1) + "#0"; - return; + if ($('table.pages input[value="Next"]')) { + window.location = "" + (g.PAGENUM + 1) + "#0"; + return; + } } } top = nav.threads[i].getBoundingClientRect().top; diff --git a/script.coffee b/script.coffee index 9f154da2b..cd6c41b11 100644 --- a/script.coffee +++ b/script.coffee @@ -571,8 +571,6 @@ keybinds = return nav = - #TODO page nav - #FIXME /b/ # ◀ ▶ init: -> span = $.el 'span', @@ -627,8 +625,10 @@ nav = # if we're at the last thread, or we're at the bottom of the page. # kind of hackish, what we really need to do is make nav.getThread smarter. if i is nav.threads.length or (innerHeight + pageYOffset == d.body.scrollHeight) - window.location = "#{g.PAGENUM + 1}#0" - return + if $ 'table.pages input[value="Next"]' + window.location = "#{g.PAGENUM + 1}#0" + return + #TODO sfx {top} = nav.threads[i].getBoundingClientRect() window.scrollBy 0, top