Commit f5ce6617 authored by fat's avatar fat
Browse files

fix event binding in modal.js

parent a7a87c8e
6 merge requests!8635ignore Gruntfile.js in jekyll,!8339Fix broken links to navbar component in docs examples,!8157Close Me: Docs "Customize and Download" button fix,!8656Added rel="stylesheet" to CDN-Examples,!8527Inner properties move 1,!8245Interactive color picker - Closed: request against wrong branch
Showing with 15 additions and 15 deletions
+15 -15
...@@ -872,18 +872,18 @@ ...@@ -872,18 +872,18 @@
Modal.prototype.enforceFocus = function () { Modal.prototype.enforceFocus = function () {
$(document) $(document)
.off('focusin.bs.modal') // guard against infinite focus loop .off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', function (e) { .on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.focus() this.$element.focus()
} }
}, this) }, this))
} }
Modal.prototype.escape = function () { Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) { if (this.isShown && this.options.keyboard) {
this.$element.on('keyup.dismiss.bs.modal', function ( e ) { this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide() e.which == 27 && this.hide()
}, this) }, this))
} else if (!this.isShown) { } else if (!this.isShown) {
this.$element.off('keyup.dismiss.bs.modal') this.$element.off('keyup.dismiss.bs.modal')
} }
......
This diff is collapsed.
...@@ -106,18 +106,18 @@ ...@@ -106,18 +106,18 @@
Modal.prototype.enforceFocus = function () { Modal.prototype.enforceFocus = function () {
$(document) $(document)
.off('focusin.bs.modal') // guard against infinite focus loop .off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', function (e) { .on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.focus() this.$element.focus()
} }
}, this) }, this))
} }
Modal.prototype.escape = function () { Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) { if (this.isShown && this.options.keyboard) {
this.$element.on('keyup.dismiss.bs.modal', function ( e ) { this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide() e.which == 27 && this.hide()
}, this) }, this))
} else if (!this.isShown) { } else if (!this.isShown) {
this.$element.off('keyup.dismiss.bs.modal') this.$element.off('keyup.dismiss.bs.modal')
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment