mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-09-23 10:29:11 +00:00
Merge "CommentController: Scroll before focusing in showAndFocus"
This commit is contained in:
commit
31c35992f4
|
@ -346,12 +346,10 @@ CommentController.prototype.focus = function () {
|
|||
|
||||
CommentController.prototype.showAndFocus = function () {
|
||||
var commentController = this;
|
||||
this.focus();
|
||||
// Calling can trigger a scroll-into-view within VE, so wait for this to
|
||||
// happen so it doesn't cancel our scrolling of the whole widget into view
|
||||
setTimeout( function () {
|
||||
commentController.replyWidget.scrollElementIntoView( { padding: scrollPadding } );
|
||||
} );
|
||||
this.replyWidget.scrollElementIntoView( { padding: scrollPadding } )
|
||||
.then( function () {
|
||||
commentController.focus();
|
||||
} );
|
||||
};
|
||||
|
||||
CommentController.prototype.teardown = function ( mode ) {
|
||||
|
|
Loading…
Reference in a new issue