8000 only fire hidden once backdrop has been removed · rusongyu/bootstrap@366e1e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 366e1e0

Browse files
committed
only fire hidden once backdrop has been removed
1 parent 1bf070b commit 366e1e0

File tree

4 files changed

+28
-25
lines changed

4 files changed

+28
-25
lines changed

docs/assets/js/bootstrap-modal.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,13 @@
138138
})
139139
}
140140

141-
, hideModal: function (that) {
142-
this.$element
143-
.hide()
144-
.trigger('hidden')
145-
146-
this.backdrop()
141+
, hideModal: function () {
142+
var that = this
143+
this.$element.hide()
144+
this.backdrop(function () {
145+
that.removeBackdrop()
146+
that.$element.trigger('hidden')
147+
})
147148
}
148149

149150
, removeBackdrop: function () {
@@ -181,8 +182,8 @@
181182
this.$backdrop.removeClass('in')
182183

183184
$.support.transition && this.$element.hasClass('fade')?
184-
this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
185-
this.removeBackdrop()
185+
this.$backdrop.one($.support.transition.end, callback) :
186+
callback()
186187

187188
} else if (callback) {
188189
callback()

docs/assets/js/bootstrap.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -936,12 +936,13 @@
936936
})
937937
}
938938

939-
, hideModal: function (that) {
940-
this.$element
941-
.hide()
942-
.trigger('hidden')
943-
944-
this.backdrop()
939+
, hideModal: function () {
940+
var that = this
941+
this.$element.hide()
942+
this.backdrop(function () {
943+
that.removeBackdrop()
944+
that.$element.trigger('hidden')
945+
})
945946
}
946947

947948
, removeBackdrop: function () {
@@ -979,8 +980,8 @@
979980
this.$backdrop.removeClass('in')
980981

981982
$.support.transition && this.$element.hasClass('fade')?
982-
this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
983-
this.removeBackdrop()
983+
this.$backdrop.one($.support.transition.end, callback) :
984+
callback()
984985

985986
} else if (callback) {
986987
callback()

0 commit comments

Comments
 (0)
0