diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 973298cf1..95559749f 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -12048,7 +12048,7 @@ return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title; }, navigate: function(e) { - var boardID, hash, onload, path, threadID, view; + var boardID, hash, onload, pageNum, path, threadID, view; if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) { return; } @@ -12068,7 +12068,12 @@ if (this.id !== 'popState') { history.pushState(null, '', this.pathname); } - view = threadID ? 'thread' : view || 'index'; + if (threadID) { + view = 'thread'; + } else { + pageNum = view; + view = 'index'; + } if (view !== g.VIEW) { Navigate.disconnect(); Navigate.clean(); @@ -12081,7 +12086,11 @@ } else { Navigate.updateBoard(boardID); } - return Index.update(); + if (Conf['Index Mode'] === 'paged' && pageNum) { + return Index.update(pageNum); + } else { + return Index.update(); + } } else { onload = function(e) { return Navigate.load(e, hash); diff --git a/builds/crx/script.js b/builds/crx/script.js index 8842592e9..584f1fe19 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -12037,7 +12037,7 @@ return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title; }, navigate: function(e) { - var boardID, hash, onload, path, threadID, view; + var boardID, hash, onload, pageNum, path, threadID, view; if (this.hostname !== 'boards.4chan.org' || window.location.hostname === 'rs.4chan.org' || (e && (e.shiftKey || (e.type === 'click' && e.button !== 0)))) { return; } @@ -12057,7 +12057,12 @@ if (this.id !== 'popState') { history.pushState(null, '', this.pathname); } - view = threadID ? 'thread' : view || 'index'; + if (threadID) { + view = 'thread'; + } else { + pageNum = view; + view = 'index'; + } if (view !== g.VIEW) { Navigate.disconnect(); Navigate.clean(); @@ -12070,7 +12075,11 @@ } else { Navigate.updateBoard(boardID); } - return Index.update(); + if (Conf['Index Mode'] === 'paged' && pageNum) { + return Index.update(pageNum); + } else { + return Index.update(); + } } else { onload = function(e) { return Navigate.load(e, hash); diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 7afc5702e..4fe66277c 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -185,10 +185,11 @@ Navigate = e.preventDefault() if e history.pushState null, '', @pathname unless @id is 'popState' - view = if threadID - 'thread' + if threadID + view = 'thread' else - view or 'index' # path is "/boardID/". See the problem? + pageNum = view + view = 'index' # path is "/boardID/". See the problem? if view isnt g.VIEW Navigate.disconnect() @@ -201,7 +202,11 @@ Navigate = d.title = $('.boardTitle').textContent else Navigate.updateBoard boardID - Index.update() + + if Conf['Index Mode'] is 'paged' and pageNum + Index.update pageNum + else + Index.update() # Moving from index to thread or thread to thread else