simplify request callback

This commit is contained in:
James Campos 2010-12-28 16:52:06 -08:00
parent f7e2ddbff5
commit c2985dbe95
2 changed files with 6 additions and 8 deletions

View File

@ -806,13 +806,13 @@ threadF = (current) ->
request = (url, callback) ->
r = new XMLHttpRequest()
r.onload = -> callback this
r.onload = callback
r.open 'get', url, true
r.send()
r
updateCallback = (res) ->
body = n 'body', innerHTML: res.responseText
updateCallback = ->
body = n 'body', innerHTML: @responseText
replies = $$ 'td.reply', body
root = $('br[clear]').previousElementSibling

View File

@ -1064,17 +1064,15 @@
request = function(url, callback) {
var r;
r = new XMLHttpRequest();
r.onload = function() {
return callback(this);
};
r.onload = callback;
r.open('get', url, true);
r.send();
return r;
};
updateCallback = function(res) {
updateCallback = function() {
var body, count, i, id, replies, reply, root, span, table;
body = n('body', {
innerHTML: res.responseText
innerHTML: this.responseText
});
replies = $$('td.reply', body);
root = $('br[clear]').previousElementSibling;