From a71d5d8e991eee4073d3312743778b1991cfb650 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 10 Sep 2011 19:01:16 -0700 Subject: add the dhg flavor back --- js/bootstrap-modal.js | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 4843d2b727..a7ab252ebc 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -59,16 +59,17 @@ this.isShown = true _.escape.call(this) - _.backdrop.call(this) - - this.$element - .appendTo(document.body) - .show() + _.backdrop.call(this, function () { + that.$element + .appendTo(document.body) + .show() - setTimeout(function () { - that.$element.addClass('in').trigger('modal:shown') - that.$backdrop && that.$backdrop.addClass('in') - }, 1) + setTimeout(function () { + that.$element + .addClass('in') + .trigger('modal:shown') + }, 1) + }) return this } @@ -81,7 +82,6 @@ this.isShown = false _.escape.call(this) - _.backdrop.call(this) this.$element.removeClass('in') @@ -89,6 +89,8 @@ that.$element .detach() .trigger('modal:hidden') + + _.backdrop.call(that) } $.support.transition && this.$element.hasClass('fade') ? @@ -106,13 +108,20 @@ var _ = { - backdrop: function () { + backdrop: function ( callback ) { var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' if ( this.isShown && this.settings.backdrop ) { this.$backdrop = $('