Skip to content

Commit 3074737

Browse files
committed
Merge pull request twbs#5549 from mfansler/2.1.2-wip
fixes twbs#5336: reorder focus() call to avoid scrolling
2 parents e0a007b + e24b46b commit 3074737

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

docs/assets/js/bootstrap-modal.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@
7070
that.$element
7171
.addClass('in')
7272
.attr('aria-hidden', false)
73-
.focus()
7473

7574
that.enforceFocus()
7675

7776
transition ?
78-
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
79-
that.$element.trigger('shown')
77+
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
78+
that.$element.focus().trigger('shown')
8079

8180
})
8281
}
@@ -232,4 +231,4 @@
232231
})
233232
})
234233

235-
}(window.jQuery);
234+
}(window.jQuery);

docs/assets/js/bootstrap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,13 +794,12 @@
794794
that.$element
795795
.addClass('in')
796796
.attr('aria-hidden', false)
797-
.focus()
798797

799798
that.enforceFocus()
800799

801800
transition ?
802-
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
803-
that.$element.trigger('shown')
801+
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
802+
that.$element.focus().trigger('shown')
804803

805804
})
806805
}
@@ -956,7 +955,8 @@
956955
})
957956
})
958957

959-
}(window.jQuery);/* ===========================================================
958+
}(window.jQuery);
959+
/* ===========================================================
960960
* bootstrap-tooltip.js v2.1.2
961961
* http://twitter.github.com/bootstrap/javascript.html#tooltips
962962
* Inspired by the original jQuery.tipsy by Jason Frame

0 commit comments

Comments
 (0)