From e24b46b7f3fb9eab5f34fb6e199d24781204c745 Mon Sep 17 00:00:00 2001 From: mfansler Date: Tue, 16 Oct 2012 12:27:43 -0400 Subject: fixes #5336: reorder focus() call to avoid scrolling --- js/bootstrap-modal.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index d53f13a00..d2a4878b3 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -70,13 +70,12 @@ that.$element .addClass('in') .attr('aria-hidden', false) - .focus() that.enforceFocus() transition ? - that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : - that.$element.trigger('shown') + that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : + that.$element.focus().trigger('shown') }) } @@ -232,4 +231,4 @@ }) }) -}(window.jQuery); \ No newline at end of file +}(window.jQuery); -- cgit v1.2.3