From 6f45d4182346098e8726a5b73a944d25c5b14a97 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 8 Jan 2014 21:49:35 -0700 Subject: [PATCH] Change .current click behavior --- builds/4chan-X.user.js | 2 ++ builds/crx/script.js | 2 ++ src/General/Index.coffee | 3 +++ 3 files changed, 7 insertions(+) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 5f353b5a3..d293cb87a 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2320,6 +2320,7 @@ return; } e.preventDefault(); + history.pushState(null, '', this.pathname); return Index.update(); } }, @@ -2671,6 +2672,7 @@ nodes = Index.sortedNodes; } $.rmAll(Index.root); + $.rmAll(Header.hover); if (Conf['Show Replies']) { Index.buildReplies(nodes); } diff --git a/builds/crx/script.js b/builds/crx/script.js index ee326ade1..13b4be5f0 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -2330,6 +2330,7 @@ return; } e.preventDefault(); + history.pushState(null, '', this.pathname); return Index.update(); } }, @@ -2681,6 +2682,7 @@ nodes = Index.sortedNodes; } $.rmAll(Index.root); + $.rmAll(Header.hover); if (Conf['Show Replies']) { Index.buildReplies(nodes); } diff --git a/src/General/Index.coffee b/src/General/Index.coffee index d0925bbaa..7156bc12f 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -130,6 +130,7 @@ Index = link: (e) -> return if g.VIEW isnt 'index' or /catalog/.test @href e.preventDefault() + history.pushState null, '', @pathname Index.update() scrollToIndex: -> @@ -363,10 +364,12 @@ Index = else nodes = Index.sortedNodes $.rmAll Index.root + $.rmAll Header.hover Index.buildReplies nodes if Conf['Show Replies'] $.event 'IndexBuild', nodes $.add Index.root, nodes + isSearching: false clearSearch: -> Index.searchInput.value = null