Skip to content

Commit

Permalink
Remove duplicate code.
Browse files Browse the repository at this point in the history
  • Loading branch information
hyphyphyph committed Jun 5, 2012
1 parent fae23cc commit 87ff76e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion build/ui.js
Expand Up @@ -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();
});
Expand All @@ -576,7 +584,7 @@ Confirmation.prototype.render = function(options){
});
}
else{
self.callback(true) !== false && self.hide();
(self.callback(true) !== false && self.hide());
}
});
};
Expand Down
2 changes: 0 additions & 2 deletions lib/components/confirmation/confirmation.js
Expand Up @@ -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){
Expand Down

0 comments on commit 87ff76e

Please sign in to comment.