Skip to content

Instantly share code, notes, and snippets.

@bittersweetryan
Created June 7, 2012 17:44
Show Gist options
  • Save bittersweetryan/2890286 to your computer and use it in GitHub Desktop.
Save bittersweetryan/2890286 to your computer and use it in GitHub Desktop.
deferred to control animation timings
displayMessage: function(ev){
var id = ev.currentTarget.id,
dfd = $.Deferred(),
self = this,
statusCell = this.getStatusCell($(ev.currentTarget));
this.model.set('id',id);
if(statusCell.find('img').attr('alt') === 'unread'){
this.removeBold($(ev.currentTarget));
iris.tabView.decrementUnreadMessageCount();
}
this.setIcon(statusCell,true);
$.when(
this.model.fetch(),
this.hide(dfd)
).then(function(){
iris.messageView.render(self.model);
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment