From 6af9e3587c7dd80f78dde727142b1d444f74a2ab Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 25 Apr 2011 19:15:01 -0700 Subject: [PATCH] first thread, prev thread -> prev page --- 4chan_x.js | 6 +++++- script.coffee | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index e1a77c0db..c40255dcb 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -824,7 +824,11 @@ i += delta; } if (i === -1) { - window.scrollTo(0, 0); + if (g.PAGENUM === 0) { + window.scrollTo(0, 0); + } else { + window.location = "" + (g.PAGENUM - 1) + "#p0"; + } return; } if (delta === +1) { diff --git a/script.coffee b/script.coffee index e6c499f4c..a519d1a0b 100644 --- a/script.coffee +++ b/script.coffee @@ -613,7 +613,10 @@ nav = i += delta if i is -1 - window.scrollTo 0, 0 + if g.PAGENUM is 0 + window.scrollTo 0, 0 + else + window.location = "#{g.PAGENUM - 1}#p0" return if delta is +1 # if we're at the last thread, or we're at the bottom of the page.