Skip to content

Commit

Permalink
fix backdrop: true for older bootstrap versions
Browse files Browse the repository at this point in the history
  • Loading branch information
makeusabrew committed Feb 22, 2015
1 parent 199fecc commit e7e2e44
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bootbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,11 @@
dialog.on("click.dismiss.bs.modal", function(e) {
// @NOTE: the target varies in >= 3.3.x releases since the modal backdrop
// moved *inside* the outer dialog rather than *alongside* it
// As such backdrop: true only currently works with 3.3.x Bootstrap releases
var target = options.backdrop ? dialog.children(".modal-backdrop").get(0) : e.currentTarget;
if (dialog.children(".modal-backdrop").length) {
e.currentTarget = dialog.children(".modal-backdrop").get(0);
}

if (e.target !== target) {
if (e.target !== e.currentTarget) {
return;
}

Expand Down

0 comments on commit e7e2e44

Please sign in to comment.