diff --git a/4chan_x.js b/4chan_x.js index d99e3d88a..929d5a3fa 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1461,7 +1461,7 @@ }; watcher = { init: function() { - var board, dialog, favicon, html, id, input, inputs, props, src, watched, watchedBoard, _i, _len, _ref, _results; + var dialog, favicon, html, id, input, inputs, src, watched, watchedBoard, _i, _len, _results; html = '
Thread Watcher
'; dialog = ui.dialog('watcher', { top: '50px', @@ -1469,13 +1469,7 @@ }, html); $.append(d.body, dialog); watched = $.getValue('watched', {}); - for (board in watched) { - _ref = watched[board]; - for (id in _ref) { - props = _ref[id]; - watcher.addLink(props, dialog); - } - } + watcher.list(watched); watchedBoard = watched[g.BOARD] || {}; inputs = $$('form > input[value=delete], div.thread > input[value=delete]'); _results = []; @@ -1520,7 +1514,6 @@ }, addLink: function(props, dialog) { var div, link, x; - dialog || (dialog = $('#watcher')); div = $.el('div'); x = $.el('a', { textContent: 'X' diff --git a/script.coffee b/script.coffee index 8238de541..d5b3ee50f 100644 --- a/script.coffee +++ b/script.coffee @@ -1165,9 +1165,7 @@ watcher = #populate watcher watched = $.getValue 'watched', {} - for board of watched - for id, props of watched[board] - watcher.addLink props, dialog + watcher.list watched #add watch buttons watchedBoard = watched[g.BOARD] or {} @@ -1194,7 +1192,6 @@ watcher = watcher.addLink props, $ '#watcher' addLink: (props, dialog) -> - dialog or= $ '#watcher' div = $.el 'div' x = $.el 'a', textContent: 'X'