diff options
| author | fat <[email protected]> | 2013-05-29 11:24:00 -0400 |
|---|---|---|
| committer | fat <[email protected]> | 2013-05-29 11:24:00 -0400 |
| commit | f5ce66177bba1e5613a481d7d2a0e9bcfab077f0 (patch) | |
| tree | 6b2d91b590c6c3b7f2046f57df1af3fe7758bd2b /js | |
| parent | a7a87c8e8c3343f6d9dea868d578178de8907f98 (diff) | |
| download | bootstrap-f5ce66177bba1e5613a481d7d2a0e9bcfab077f0.tar.xz bootstrap-f5ce66177bba1e5613a481d7d2a0e9bcfab077f0.zip | |
fix event binding in modal.js
Diffstat (limited to 'js')
| -rw-r--r-- | js/modal.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/js/modal.js b/js/modal.js index 07b508124..81766b323 100644 --- a/js/modal.js +++ b/js/modal.js @@ -106,18 +106,18 @@ Modal.prototype.enforceFocus = function () { $(document) .off('focusin.bs.modal') // guard against infinite focus loop - .on('focusin.bs.modal', function (e) { - if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { - this.$element.focus() - } - }, this) + .on('focusin.bs.modal', $.proxy(function (e) { + if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { + this.$element.focus() + } + }, this)) } Modal.prototype.escape = function () { 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() - }, this) + }, this)) } else if (!this.isShown) { this.$element.off('keyup.dismiss.bs.modal') } |
