From 366e1e0a6d1442b8cf8546a27bac44a841b892a2 Mon Sep 17 00:00:00 2001 From: fat Date: Thu, 7 Feb 2013 20:13:40 -0800 Subject: only fire hidden once backdrop has been removed --- docs/assets/js/bootstrap-modal.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'docs/assets/js/bootstrap-modal.js') diff --git a/docs/assets/js/bootstrap-modal.js b/docs/assets/js/bootstrap-modal.js index 379da60879..b5ffa95b3b 100644 --- a/docs/assets/js/bootstrap-modal.js +++ b/docs/assets/js/bootstrap-modal.js @@ -138,12 +138,13 @@ }) } - , hideModal: function (that) { - this.$element - .hide() - .trigger('hidden') - - this.backdrop() + , hideModal: function () { + var that = this + this.$element.hide() + this.backdrop(function () { + that.removeBackdrop() + that.$element.trigger('hidden') + }) } , removeBackdrop: function () { @@ -181,8 +182,8 @@ this.$backdrop.removeClass('in') $.support.transition && this.$element.hasClass('fade')? - this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) : - this.removeBackdrop() + this.$backdrop.one($.support.transition.end, callback) : + callback() } else if (callback) { callback() -- cgit v1.2.3