Fix Updater.update when it's executed as an event callback.
This commit is contained in:
parent
f38f8fa9e9
commit
1079cf1434
@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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: ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user