Automatic watcher updates.

This commit is contained in:
Nicolas Stepien 2011-05-05 18:16:21 +02:00
parent f8fe6bd137
commit 484740da11
2 changed files with 8 additions and 5 deletions

View File

@ -1464,7 +1464,7 @@
};
watcher = {
init: function() {
var dialog, favicon, html, input, inputs, watched, _i, _len;
var dialog, favicon, html, input, inputs, _i, _len;
html = '<div class=move>Thread Watcher</div>';
dialog = ui.dialog('watcher', {
top: '50px',
@ -1480,8 +1480,10 @@
$.bind(favicon, 'click', watcher.cb.toggle);
$.before(input, favicon);
}
watched = $.getValue('watched', {});
return watcher.refresh(watched);
watcher.refresh($.getValue('watched', {}));
return setInterval((function() {
return watcher.refresh($.getValue('watched', {}));
}), 1000);
},
refresh: function(watched) {
var board, div, favicon, id, props, watchedBoard, _i, _j, _len, _len2, _ref, _ref2, _ref3, _results;

View File

@ -1176,8 +1176,9 @@ watcher =
$.before input, favicon
#populate watcher, display watch buttons
watched = $.getValue 'watched', {}
watcher.refresh watched
watcher.refresh $.getValue 'watched', {}
setInterval (-> watcher.refresh($.getValue 'watched', {}) ), 1000
refresh: (watched) ->
for div in $$ '#watcher > div:not(.move)'