Permalink
Browse files

Remove duplicate code.

  • Loading branch information...
1 parent fae23cc commit 87ff76ebac01a0df260dc61435cafb6fefd0aa54 @hyphyphyph committed Jun 5, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −1 build/ui.js
  2. +0 −2 lib/components/confirmation/confirmation.js
View
@@ -563,6 +563,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();
});
@@ -576,7 +584,7 @@ Confirmation.prototype.render = function(options){
});
}
else{
- self.callback(true) !== false && self.hide();
+ (self.callback(true) !== false && self.hide());
}
});
};
@@ -129,8 +129,6 @@ Confirmation.prototype.render = function(options){
else {
(self.callback(false) !== false && self.hide());
}
- self.callback(false)
- self.hide();
});
actions.find('.ok').click(function(e){

0 comments on commit 87ff76e

Please sign in to comment.