From e7e411142f407290b9e7c66d3f389cb50afc10c1 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 9 Jan 2014 14:16:16 -0700 Subject: [PATCH] Better --- builds/4chan-X.user.js | 7 +++---- builds/crx/script.js | 7 +++---- src/General/Index.coffee | 5 ++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 154beee3a..188c43b10 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -2450,13 +2450,12 @@ return $.add(strong, a); }, update: function(pageNum) { - var board, now, onload, _ref, _ref1; + var now, onload, _ref, _ref1; if (!navigator.onLine) { return; } - if (d.readyState !== 'loading' && Index.root.parentElement) { - board = $('.board'); - $.replace(board, Index.root); + if (!(d.readyState === 'loading' || Index.root.parentElement)) { + $.replace($('.board', Index.root)); } if ((_ref = Index.req) != null) { _ref.abort(); diff --git a/builds/crx/script.js b/builds/crx/script.js index da0e6ad04..e25885262 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -2460,13 +2460,12 @@ return $.add(strong, a); }, update: function(pageNum) { - var board, now, onload, _ref, _ref1; + var now, onload, _ref, _ref1; if (!navigator.onLine) { return; } - if (d.readyState !== 'loading' && Index.root.parentElement) { - board = $('.board'); - $.replace(board, Index.root); + if (!(d.readyState === 'loading' || Index.root.parentElement)) { + $.replace($('.board', Index.root)); } if ((_ref = Index.req) != null) { _ref.abort(); diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 27d47a0fa..233ec84a1 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -203,9 +203,8 @@ Index = update: (pageNum) -> return unless navigator.onLine - if d.readyState isnt 'loading' and Index.root.parentElement - board = $ '.board' - $.replace board, Index.root + unless d.readyState is 'loading' or Index.root.parentElement + $.replace $ '.board', Index.root Index.req?.abort() Index.notice?.close()