Keep the hacky scope workaround in comments.js
because we still are supporting browsers without .bind() and I do not want to break the patterns here. Follow up to #6171 - I wanted to avoid feedback loop delays for that little change.
This commit is contained in:
parent
f8ff950672
commit
aa86003cf9
1 changed files with 3 additions and 2 deletions
|
|
@ -11,13 +11,14 @@ app.collections.Comments = Backbone.Collection.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
make : function(text) {
|
make : function(text) {
|
||||||
|
var self = this;
|
||||||
var comment = new app.models.Comment({ "text": text });
|
var comment = new app.models.Comment({ "text": text });
|
||||||
|
|
||||||
var deferred = comment.save({}, {
|
var deferred = comment.save({}, {
|
||||||
url: "/posts/"+ this.post.id +"/comments",
|
url: "/posts/"+ this.post.id +"/comments",
|
||||||
success: function() {
|
success: function() {
|
||||||
comment.set({author: app.currentUser.toJSON(), parent: this.post });
|
comment.set({author: app.currentUser.toJSON(), parent: self.post });
|
||||||
this.add(comment);
|
self.add(comment);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue