Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tweak show / hide events
  • Loading branch information
HenrikJoreteg authored and tj committed Apr 25, 2012
1 parent baec734 commit 4660f10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion build/ui.js
Expand Up @@ -285,12 +285,17 @@ Dialog.prototype.escapable = function(){
*/

Dialog.prototype.show = function(){
<<<<<<< HEAD
var overlay = this._overlay;

this.emit('show');
if (overlay) {
overlay.show();
=======
if (this._overlay) {
this._overlay.show();
>>>>>>> 10fed691dac10ff5328606ca0d420b76e6d3ed94
this.el.addClass('modal');
}
Expand All @@ -299,6 +304,7 @@ Dialog.prototype.show = function(){
this.el.appendTo('body');
this.el.css({ marginLeft: -(this.el.width() / 2) + 'px' });
this.emit('show');
return this;
};
Expand All @@ -315,7 +321,6 @@ Dialog.prototype.show = function(){
Dialog.prototype.hide = function(ms){
var self = this;
this.emit('hide');
// duration
if (ms) {
Expand Down Expand Up @@ -349,6 +354,7 @@ Dialog.prototype.hide = function(ms){
*/

Dialog.prototype.remove = function(){
this.emit('hide');
this.el.remove();
return this;
};
Expand Down
3 changes: 2 additions & 1 deletion lib/components/dialog/dialog.js
Expand Up @@ -193,6 +193,7 @@ Dialog.prototype.show = function(){

this.el.appendTo('body');
this.el.css({ marginLeft: -(this.el.width() / 2) + 'px' });
this.emit('show');
return this;
};

Expand All @@ -209,7 +210,6 @@ Dialog.prototype.show = function(){

Dialog.prototype.hide = function(ms){
var self = this;
this.emit('hide');

// duration
if (ms) {
Expand Down Expand Up @@ -243,6 +243,7 @@ Dialog.prototype.hide = function(ms){
*/

Dialog.prototype.remove = function(){
this.emit('hide');
this.el.remove();
return this;
};

0 comments on commit 4660f10

Please sign in to comment.