From 8d30da48852ddf5163f83171488fe84ea67ea262 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 4 May 2011 18:42:25 +0200 Subject: [PATCH] This is wrong and you know it. --- 4chan_x.js | 14 ++++++++------ script.coffee | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 3e73a3e75..ce589e7d6 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1491,18 +1491,20 @@ return _results; }, refresh: function(watched) { - var board, div, id, props, _results; - while (div = $('#watcher > div:not(.move)')) { + var board, div, id, props, _i, _len, _ref, _results; + _ref = $$('#watcher > div:not(.move)'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + div = _ref[_i]; $.remove(div); } _results = []; for (board in watched) { _results.push((function() { - var _ref, _results2; - _ref = watched[board]; + var _ref2, _results2; + _ref2 = watched[board]; _results2 = []; - for (id in _ref) { - props = _ref[id]; + for (id in _ref2) { + props = _ref2[id]; _results2.push(watcher.addLink(props, $('#watcher'))); } return _results2; diff --git a/script.coffee b/script.coffee index b6087329b..c8cce8408 100644 --- a/script.coffee +++ b/script.coffee @@ -1183,7 +1183,7 @@ watcher = $.before input, favicon refresh: (watched) -> - while div = $ '#watcher > div:not(.move)' + for div in $$ '#watcher > div:not(.move)' $.remove div for board of watched for id, props of watched[board]