Skip to content

Instantly share code, notes, and snippets.

@joegaudet
Created September 7, 2010 18:17
Show Gist options
  • Save joegaudet/568772 to your computer and use it in GitHub Desktop.
Save joegaudet/568772 to your computer and use it in GitHub Desktop.
destroyComment : function(comment) {
this.set('_comment', comment);
SC.AlertPane.error("Are you sure you want to delete this comment.", "This action is irreversable, and will permanently remove this comment from the system.", null, "Ok", "Cancel", null, this);
},
alertPaneDidDismiss : function(pane, status) {
if (status == SC.BUTTON1_STATUS) {
var comment = this.get('_comment');
this.get('content').removeObject(comment);
this.invokeLater(function(){
comment.destroy();
comment.commitRecord();
});
}
else {
this.set('_comment', null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment