more instrumentation [ci skip]

This commit is contained in:
danielgrippi 2012-05-30 19:26:03 -07:00
parent dac781cb4f
commit 8e2657d26b

View file

@ -64,6 +64,8 @@ app.models.Post.Interactions = Backbone.Model.extend({
self.trigger("change") self.trigger("change")
self.set({"likes_count" : self.get("likes_count") + 1}) self.set({"likes_count" : self.get("likes_count") + 1})
}}) }})
app.instrument("track", "Like")
}, },
unlike : function() { unlike : function() {
@ -72,6 +74,8 @@ app.models.Post.Interactions = Backbone.Model.extend({
self.trigger('change') self.trigger('change')
self.set({"likes_count" : self.get("likes_count") - 1}) self.set({"likes_count" : self.get("likes_count") - 1})
}}); }});
app.instrument("track", "Unlike")
}, },
comment : function (text) { comment : function (text) {
@ -84,6 +88,8 @@ app.models.Post.Interactions = Backbone.Model.extend({
}); });
this.trigger("change") //updates count in an eager manner this.trigger("change") //updates count in an eager manner
app.instrument("track", "Comment")
}, },
reshare : function(){ reshare : function(){
@ -103,6 +109,8 @@ app.models.Post.Interactions = Backbone.Model.extend({
}).done(function(){ }).done(function(){
interactions.trigger("change") interactions.trigger("change")
}); });
app.instrument("track", "Reshare")
}, },
userCanReshare : function(){ userCanReshare : function(){