Skip to content

Commit 4504654

Browse files
committed
when static, refocus on click
1 parent 0b9d4e7 commit 4504654

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

docs/assets/js/bootstrap-modal.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@
162162
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
163163
.appendTo(document.body)
164164

165-
if (this.options.backdrop != 'static') {
166-
this.$backdrop.click($.proxy(this.hide, this))
167-
}
165+
this.$backdrop.click(
166+
this.options.backdrop == 'static' ?
167+
$.proxy(this.$element[0].focus, this.$element[0])
168+
: $.proxy(this.hide, this)
169+
)
168170

169171
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
170172

docs/assets/js/bootstrap.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,11 @@
878878
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
879879
.appendTo(document.body)
880880

881-
if (this.options.backdrop != 'static') {
882-
this.$backdrop.click($.proxy(this.hide, this))
883-
}
881+
this.$backdrop.click(
882+
this.options.backdrop == 'static' ?
883+
$.proxy(this.$element[0].focus, this.$element[0])
884+
: $.proxy(this.hide, this)
885+
)
884886

885887
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
886888

0 commit comments

Comments
 (0)