From d2ea7169023400372d1c73760ef2d7ae7eb20f45 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Tue, 13 Dec 2016 15:44:54 +0000 Subject: [PATCH] Don't restore scroll position when doing real section editing (NWE) Bug: T152946 Change-Id: I969a8edd4f23bbe6c73855aac059df732102c560 --- .../ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index 5a6046af60..6cd49fb8fa 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -1155,7 +1155,12 @@ ve.init.mw.DesktopArticleTarget.prototype.getSaveDialogOpeningData = function () * Remember the window's scroll position. */ ve.init.mw.DesktopArticleTarget.prototype.saveScrollPosition = function () { - this.scrollTop = $( window ).scrollTop(); + if ( this.getDefaultMode() === 'source' && this.section !== null ) { + // Reset scroll to top if doing real section editing + this.scrollTop = 0; + } else { + this.scrollTop = $( window ).scrollTop(); + } }; /**