From 55453f02e486fcdb7b5a851098193b18077ac89a Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Fri, 10 Jan 2014 20:18:04 -0700 Subject: [PATCH] The refresh button behavior should be dependent on the view --- builds/4chan-X.user.js | 8 +++++++- builds/crx/script.js | 8 +++++++- src/General/Index.coffee | 5 ++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 6be194a6d..592e086ce 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2160,7 +2160,7 @@ } this.button = $.el('a', { className: 'index-refresh-shortcut fa fa-refresh', - title: 'Refresh Index', + title: 'Refresh', href: 'javascript:;', textContent: 'Refresh Index' }); @@ -2449,6 +2449,12 @@ if (!navigator.onLine) { return; } + if (g.VIEW === 'thread') { + if (Conf['Thread Updater']) { + return ThreadUpdater.update(); + } + return; + } if (!(d.readyState === 'loading' || Index.root.parentElement)) { $.replace($('.board'), Index.root); } diff --git a/builds/crx/script.js b/builds/crx/script.js index ac79e6c79..a62ca9df5 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -2170,7 +2170,7 @@ } this.button = $.el('a', { className: 'index-refresh-shortcut fa fa-refresh', - title: 'Refresh Index', + title: 'Refresh', href: 'javascript:;', textContent: 'Refresh Index' }); @@ -2459,6 +2459,12 @@ if (!navigator.onLine) { return; } + if (g.VIEW === 'thread') { + if (Conf['Thread Updater']) { + return ThreadUpdater.update(); + } + return; + } if (!(d.readyState === 'loading' || Index.root.parentElement)) { $.replace($('.board'), Index.root); } diff --git a/src/General/Index.coffee b/src/General/Index.coffee index a2c6038ab..a7e33a362 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -4,7 +4,7 @@ Index = @button = $.el 'a', className: 'index-refresh-shortcut fa fa-refresh' - title: 'Refresh Index' + title: 'Refresh' href: 'javascript:;' textContent: 'Refresh Index' $.on @button, 'click', @update @@ -203,6 +203,9 @@ Index = update: (pageNum) -> return unless navigator.onLine + if g.VIEW is 'thread' + return ThreadUpdater.update() if Conf['Thread Updater'] + return unless d.readyState is 'loading' or Index.root.parentElement $.replace $('.board'), Index.root Index.req?.abort()