Fix Updater.update when it's executed as an event callback.

This commit is contained in:
Nicolas Stepien 2012-03-06 10:50:24 +01:00
parent f38f8fa9e9
commit 1079cf1434
2 changed files with 9 additions and 9 deletions

View File

@ -2691,14 +2691,14 @@
},
update: function() {
var url, _ref;
this.timer.textContent = 0;
if ((_ref = this.request) != null) _ref.abort();
Updater.timer.textContent = 0;
if ((_ref = Updater.request) != null) _ref.abort();
url = location.pathname + '?' + Date.now();
return this.request = $.ajax(url, {
onload: this.cb.update
return Updater.request = $.ajax(url, {
onload: Updater.cb.update
}, {
headers: {
'If-Modified-Since': this.lastModified
'If-Modified-Since': Updater.lastModified
}
});
}

View File

@ -2251,12 +2251,12 @@ Updater =
@update()
update: ->
@timer.textContent = 0
@request?.abort()
Updater.timer.textContent = 0
Updater.request?.abort()
#fool the cache
url = location.pathname + '?' + Date.now()
@request = $.ajax url, onload: @cb.update,
headers: 'If-Modified-Since': @lastModified
Updater.request = $.ajax url, onload: Updater.cb.update,
headers: 'If-Modified-Since': Updater.lastModified
Watcher =
init: ->