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:
Dennis Schubert 2015-07-09 03:24:15 +02:00
parent f8ff950672
commit aa86003cf9

View file

@ -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);
} }
}); });