Skip to content

Commit

Permalink
shiiiit
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Mar 1, 2013
1 parent 0992a85 commit 839b0c8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/assets/js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
}

, removeBackdrop: function () {
this.$backdrop.remove()
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@
}

, removeBackdrop: function () {
this.$backdrop.remove()
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/bootstrap.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
}

, removeBackdrop: function () {
this.$backdrop.remove()
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}

Expand Down
17 changes: 17 additions & 0 deletions js/tests/unit/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,21 @@ $(function () {
})
.modal("toggle")
})

test("should allow modal close with 'backdrop:false'", function () {
stop()
$.support.transition = false
var div = $("<div>", { id: 'modal-test', "data-backdrop": false })
div
.bind("shown", function () {
ok($('#modal-test').is(":visible"), 'modal visible')
div.modal("hide")
})
.bind("hidden", function() {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
})
.modal("show")
})
})

0 comments on commit 839b0c8

Please sign in to comment.