From a17fb49a68c26b5f945f1ddac895e26851fd56fa Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 21 Nov 2019 08:12:24 -0500 Subject: [PATCH] Scroll ReplyWidget into view Change-Id: I302346c85aacf9e410ff1468723b30fd04351032 --- modules/controller.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/controller.js b/modules/controller.js index d6a2a00a0..02e73981e 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -1,6 +1,7 @@ 'use strict'; var $pageContainer, + scrollPadding = { top: 10, bottom: 10 }, replyWidgetPromise = mw.loader.using( 'ext.discussionTools.ReplyWidget' ); function setupComment( comment ) { @@ -55,6 +56,7 @@ function setupComment( comment ) { } widgetPromise.then( function ( replyWidget ) { $( newListItem ).show(); + replyWidget.scrollElementIntoView( { padding: scrollPadding } ); replyWidget.focus(); } ); } );