mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
Scroll ReplyWidget into view
Change-Id: I302346c85aacf9e410ff1468723b30fd04351032
This commit is contained in:
parent
994c38d68c
commit
a17fb49a68
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var $pageContainer,
|
var $pageContainer,
|
||||||
|
scrollPadding = { top: 10, bottom: 10 },
|
||||||
replyWidgetPromise = mw.loader.using( 'ext.discussionTools.ReplyWidget' );
|
replyWidgetPromise = mw.loader.using( 'ext.discussionTools.ReplyWidget' );
|
||||||
|
|
||||||
function setupComment( comment ) {
|
function setupComment( comment ) {
|
||||||
|
@ -55,6 +56,7 @@ function setupComment( comment ) {
|
||||||
}
|
}
|
||||||
widgetPromise.then( function ( replyWidget ) {
|
widgetPromise.then( function ( replyWidget ) {
|
||||||
$( newListItem ).show();
|
$( newListItem ).show();
|
||||||
|
replyWidget.scrollElementIntoView( { padding: scrollPadding } );
|
||||||
replyWidget.focus();
|
replyWidget.focus();
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
Loading…
Reference in a new issue