From 7677f6bb35b256e454ac86ce4b1febc97896befc Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 2 Mar 2014 23:23:28 -0700 Subject: [PATCH] Forgot an if. --- builds/4chan-X.user.js | 6 ++++-- builds/crx/script.js | 6 ++++-- src/General/Index.coffee | 13 +++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 3e553b7c5..2c3550f7c 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2666,6 +2666,7 @@ $.on($('#returnlink a', this.navLinks), 'click', Navigate.navigate); if (g.VIEW === 'index') { this.update(); + this.cb.toggleCatalogMode(); } $.asap((function() { return $('.board', doc) || d.readyState !== 'loading'; @@ -2677,12 +2678,13 @@ $.rm(navLink); } $.after($.x('child::form/preceding-sibling::hr[1]'), Index.navLinks); - return g.VIEW !== 'index'; + if (g.VIEW !== 'index') { + return; + } board = $('.board'); $.replace(board, Index.root); return d.implementation.createDocument(null, null, null).appendChild(board); }); - this.cb.toggleCatalogMode(); return $.asap((function() { return $('.pagelist', doc) || d.readyState !== 'loading'; }), function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index c7ec43d2f..5658c25a9 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -2725,6 +2725,7 @@ $.on($('#returnlink a', this.navLinks), 'click', Navigate.navigate); if (g.VIEW === 'index') { this.update(); + this.cb.toggleCatalogMode(); } $.asap((function() { return $('.board', doc) || d.readyState !== 'loading'; @@ -2736,12 +2737,13 @@ $.rm(navLink); } $.after($.x('child::form/preceding-sibling::hr[1]'), Index.navLinks); - return g.VIEW !== 'index'; + if (g.VIEW !== 'index') { + return; + } board = $('.board'); $.replace(board, Index.root); return d.implementation.createDocument(null, null, null).appendChild(board); }); - this.cb.toggleCatalogMode(); return $.asap((function() { return $('.pagelist', doc) || d.readyState !== 'loading'; }), function() { diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 34f688bde..270956ed0 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -119,13 +119,16 @@ Index = $.on $('#index-search-clear', @navLinks), 'click', @clearSearch $.on $('#returnlink a', @navLinks), 'click', Navigate.navigate - @update() if g.VIEW is 'index' + if g.VIEW is 'index' + @update() + @cb.toggleCatalogMode() + $.asap (-> $('.board', doc) or d.readyState isnt 'loading'), -> $.rm navLink for navLink in $$ '.navLinks' $.after $.x('child::form/preceding-sibling::hr[1]'), Index.navLinks - - return g.VIEW isnt 'index' - + + return if g.VIEW isnt 'index' + board = $ '.board' $.replace board, Index.root # Hacks: @@ -137,8 +140,6 @@ Index = # Does not work on Firefox unfortunately. bugzil.la/939713 d.implementation.createDocument(null, null, null).appendChild board - @cb.toggleCatalogMode() - $.asap (-> $('.pagelist', doc) or d.readyState isnt 'loading'), -> if pagelist = $('.pagelist') $.replace pagelist, Index.pagelist