diff options
| author | Jacob Thornton <[email protected]> | 2013-05-24 23:53:44 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2013-05-24 23:53:44 -0700 |
| commit | e424b3879c751a8c0efc20d549ee066c8b1f9068 (patch) | |
| tree | a9fafc0835def6ef9eab8a2d7b343d00e8e3ae88 /js | |
| parent | f3e45c37780b12a3fa96e7d4578f38a883cba9a0 (diff) | |
| download | bootstrap-e424b3879c751a8c0efc20d549ee066c8b1f9068.tar.xz bootstrap-e424b3879c751a8c0efc20d549ee066c8b1f9068.zip | |
fixes #4781
Diffstat (limited to 'js')
| -rw-r--r-- | js/modal.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/js/modal.js b/js/modal.js index 9d6bf7339..07b508124 100644 --- a/js/modal.js +++ b/js/modal.js @@ -58,7 +58,7 @@ var transition = $.support.transition && that.$element.hasClass('fade') if (!that.$element.parent().length) { - that.$element.appendTo(document.body) //don't move modals dom position + that.$element.appendTo(document.body) // don't move modals dom position } that.$element.show() @@ -76,7 +76,6 @@ transition ? that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown.bs.modal') }) : that.$element.focus().trigger('shown.bs.modal') - }) } @@ -105,7 +104,9 @@ } Modal.prototype.enforceFocus = function () { - $(document).on('focusin.bs.modal', function (e) { + $(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() } |
