mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 21:09:06 +02:00
add proper role to dialog markup and cleanup modal logging
This commit is contained in:
10
js/bootstrap-modal.js
vendored
10
js/bootstrap-modal.js
vendored
@@ -95,7 +95,8 @@
|
||||
$('body').removeClass('modal-open')
|
||||
|
||||
this.escape()
|
||||
this.relaxFocus()
|
||||
|
||||
$(document).off('focusin.modal')
|
||||
|
||||
this.$element.removeClass('in')
|
||||
|
||||
@@ -106,20 +107,13 @@
|
||||
|
||||
, enforceFocus: function () {
|
||||
var that = this
|
||||
var console = window.console
|
||||
console.log('attach');
|
||||
$(document).on('focusin.modal', function (e) {
|
||||
console.log('triggered');
|
||||
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
|
||||
that.$element.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
, relaxFocus: function () {
|
||||
$(document).off('focus.modal')
|
||||
}
|
||||
|
||||
, escape: function () {
|
||||
var that = this
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
|
Reference in New Issue
Block a user