aboutsummaryrefslogtreecommitdiff
path: root/js/modal.js
diff options
context:
space:
mode:
authorfat <[email protected]>2013-07-17 23:01:33 -0700
committerfat <[email protected]>2013-07-17 23:01:33 -0700
commit57768d7ea9486f9fcf83701131880405e2fc01cf (patch)
treec4e00ab91596566e4e707cb49e4e28871257d802 /js/modal.js
parent6387d8d5cccca1af3767258d6b38394c9f89afae (diff)
downloadbootstrap-57768d7ea9486f9fcf83701131880405e2fc01cf.tar.xz
bootstrap-57768d7ea9486f9fcf83701131880405e2fc01cf.zip
fix #7660
Diffstat (limited to 'js/modal.js')
-rw-r--r--js/modal.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/modal.js b/js/modal.js
index 7433de4c8..43e961baa 100644
--- a/js/modal.js
+++ b/js/modal.js
@@ -160,11 +160,12 @@
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
- this.$backdrop.click(
- this.options.backdrop == 'static' ?
- $.proxy(this.$element[0].focus, this.$element[0])
- : $.proxy(this.hide, this)
- )
+ this.$element.on('click', $.proxy(function (e) {
+ if (e.target !== e.currentTarget) return
+ this.options.backdrop == 'static'
+ ? this.$element[0].focus.call(this.$element[0])
+ : this.hide.call(this)
+ }, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow