Commit 712b89ed authored by fat's avatar fat
Browse files

fixes #9362

parent 728a5e17
Showing with 22 additions and 1 deletion
+22 -1
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
var Modal = function (element, options) { var Modal = function (element, options) {
this.options = options this.options = options
this.$element = $(element).on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) this.$element = $(element)
this.$backdrop = this.$backdrop =
this.isShown = null this.isShown = null
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
this.escape() this.escape()
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.backdrop(function () { this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade') var transition = $.support.transition && that.$element.hasClass('fade')
......
...@@ -174,4 +174,23 @@ $(function () { ...@@ -174,4 +174,23 @@ $(function () {
}) })
.modal("show") .modal("show")
}) })
test("should close reopened modal with [data-dismiss=modal] click", function () {
stop()
$.support.transition = false
var div = $("<div id='modal-test'><div class='contents'><div id='close' data-dismiss='modal'></div></div></div>")
div
.bind("shown.bs.modal", function () {
$('#close').click()
ok(!$('#modal-test').is(":visible"), 'modal hidden')
})
.one("hidden.bs.modal", function() {
div.one('hidden.bs.modal', function () {
start()
}).modal("show")
})
.modal("show")
div.remove()
})
}) })
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment