memoize selected frame

This commit is contained in:
Dennis Collinson 2012-05-30 18:09:59 -07:00
parent 374ec73fa4
commit f3d1afcc96

View file

@ -28,9 +28,12 @@ app.pages.Stream = app.views.Base.extend({
}, },
selectFrame : function(post){ selectFrame : function(post){
if(this.selectedPost == post) { return }
this.selectedPost = post
this.$(".stream-frame-wrapper").removeClass("selected-frame") this.$(".stream-frame-wrapper").removeClass("selected-frame")
this.$(".stream-frame-wrapper[data-id=" + post.id +"]").addClass("selected-frame") this.$(".stream-frame-wrapper[data-id=" + this.selectedPost.id +"]").addClass("selected-frame")
this.interactionsView.setInteractions(post) this.interactionsView.setInteractions(this.selectedPost)
}, },
updateUrlState : function(){ updateUrlState : function(){