Skip to content

Commit

Permalink
when static, refocus on click
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Oct 18, 2012
1 parent 0b9d4e7 commit 4504654
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
8 changes: 5 additions & 3 deletions docs/assets/js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)

if (this.options.backdrop != 'static') {
this.$backdrop.click($.proxy(this.hide, this))
}
this.$backdrop.click(
this.options.backdrop == 'static' ?
$.proxy(this.$element[0].focus, this.$element[0])
: $.proxy(this.hide, this)
)

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

Expand Down
8 changes: 5 additions & 3 deletions docs/assets/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,11 @@
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)

if (this.options.backdrop != 'static') {
this.$backdrop.click($.proxy(this.hide, this))
}
this.$backdrop.click(
this.options.backdrop == 'static' ?
$.proxy(this.$element[0].focus, this.$element[0])
: $.proxy(this.hide, this)
)

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

Expand Down
Loading

0 comments on commit 4504654

Please sign in to comment.