Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #54 from pgherveou/patch-3

handle confirmation closed through overlay click + unbind keydown
  • Loading branch information...
commit d75189a03430a31daea19d836ea1116b7ed2c43a 2 parents f9903c8 + 3d882ef
@tj authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/components/dialog/dialog.js
2  lib/components/dialog/dialog.js
@@ -148,6 +148,7 @@ Dialog.prototype.overlay = function(){
.overlay({ closable: true })
.on('hide', function(){
self.closedOverlay = true;
+ self.emit('close');
return this;
@@ -248,5 +249,6 @@ Dialog.prototype.hide = function(ms){
Dialog.prototype.remove = function(){
+ $(document).unbind('keydown.dialog');
return this;

2 comments on commit d75189a


Just realised that there are scenario where the callback will be called twice
Sorry for the noise this will need one more pull request

if you click on the close button or the cancel button, callback is fired twice
so overlay should emit and overlayclose instead of close and we should catch this event as well to call the callback
This solution is ok for you ?


overlay only has "show" and "hide" which is fine for that component, but in here yeah we can special-case if we need to

Please sign in to comment.
Something went wrong with that request. Please try again.