Browse files

dialog: refactor Dialog#overlay()

  • Loading branch information...
1 parent a955cb9 commit c9db5deac8740eecec7e04ac4a72a7c99f7119f7 @tj tj committed Jul 11, 2012
Showing with 13 additions and 8 deletions.
  1. +13 −8 lib/components/dialog/dialog.js
View
21 lib/components/dialog/dialog.js
@@ -144,14 +144,19 @@ Dialog.prototype.modal = function(){
Dialog.prototype.overlay = function(){
var self = this;
- this._overlay = ui
- .overlay({ closable: true })
- .on('hide', function(){
- self.closedOverlay = true;
- self.hide();})
- .on('close', function(){
- self.emit('close');
- });
+ var overlay = ui.overlay({ closable: true });
+
+ overlay.on('hide', function(){
+ self.closedOverlay = true;
+ self.hide();
+ });
+
+ overlay.on('close', function(){
+ self.emit('close');
+ });
+
+ this._overlay = overlay;
+
return this;
};

0 comments on commit c9db5de

Please sign in to comment.