diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 05b2836cc..5ac520226 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1877,14 +1877,12 @@ }; SimpleDict.prototype.forEach = function(fn) { - var key, _i, _len, _ref, _results; - _ref = this.keys; - _results = []; + var key, _i, _len, _ref; + _ref = __slice.call(this.keys); for (_i = 0, _len = _ref.length; _i < _len; _i++) { key = _ref[_i]; - _results.push(fn(this[key])); + fn(this[key]); } - return _results; }; return SimpleDict; @@ -12734,6 +12732,9 @@ return; } $.addClass(Index.button, 'fa-spin'); + if (Index.isSearching) { + Index.clearSearch(); + } _ref = this.pathname.split('/'), _ = _ref[0], boardID = _ref[1], view = _ref[2], threadID = _ref[3]; if ('f' === boardID || 'f' === g.BOARD.ID) { return; diff --git a/builds/crx/script.js b/builds/crx/script.js index cdf3f7e00..fc6e64887 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1932,14 +1932,12 @@ }; SimpleDict.prototype.forEach = function(fn) { - var key, _i, _len, _ref, _results; - _ref = this.keys; - _results = []; + var key, _i, _len, _ref; + _ref = __slice.call(this.keys); for (_i = 0, _len = _ref.length; _i < _len; _i++) { key = _ref[_i]; - _results.push(fn(this[key])); + fn(this[key]); } - return _results; }; return SimpleDict; @@ -12748,6 +12746,9 @@ return; } $.addClass(Index.button, 'fa-spin'); + if (Index.isSearching) { + Index.clearSearch(); + } _ref = this.pathname.split('/'), _ = _ref[0], boardID = _ref[1], view = _ref[2], threadID = _ref[3]; if ('f' === boardID || 'f' === g.BOARD.ID) { return; diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 6649b7be9..b0230977e 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -157,6 +157,7 @@ Navigate = return if e and (e.shiftKey or e.ctrlKey or (e.type is 'click' and e.button isnt 0)) # Not simply a left click $.addClass Index.button, 'fa-spin' + Index.clearSearch() if Index.isSearching [_, boardID, view, threadID] = @pathname.split '/' diff --git a/src/General/lib/simpledict.class b/src/General/lib/simpledict.class index 229e27ba0..6c6b3edfd 100644 --- a/src/General/lib/simpledict.class +++ b/src/General/lib/simpledict.class @@ -13,4 +13,6 @@ class SimpleDict @keys.splice i, 1 delete @[key] - forEach: (fn) -> fn @[key] for key in @keys + forEach: (fn) -> + fn @[key] for key in [@keys...] + return