Permalink
Browse files

More complete (and non-notworking) async Confirmation callback support

  • Loading branch information...
1 parent 0e57ec8 commit fae23cc0fb7f5c2ec9392145c6e758c6d50a5824 @hyphyphyph committed Jun 5, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/components/confirmation/confirmation.js
@@ -121,6 +121,14 @@ Confirmation.prototype.render = function(options){
actions.find('.cancel').click(function(e){
e.preventDefault();
self.emit('cancel');
+ if(self.async){
+ self.callback(false, function () {
+ self.hide();
+ });
+ }
+ else {
+ (self.callback(false) !== false && self.hide());
+ }
self.callback(false)
self.hide();
});
@@ -134,7 +142,7 @@ Confirmation.prototype.render = function(options){
});
}
else{
- self.callback(true) !== false && self.hide();
+ (self.callback(true) !== false && self.hide());
}
});
};

0 comments on commit fae23cc

Please sign in to comment.