Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/284344

Change subject: Defer before restoring scroll position, and allow 0
......................................................................

Defer before restoring scroll position, and allow 0

Bug: T131791
Change-Id: Id48b913effe5313c193ce62b19faf5655278ff6d
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/44/284344/1

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 c3a1a53..67e085b 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -662,7 +662,11 @@
 
        // Update UI
        this.changeDocumentTitle();
-       this.restoreScrollPosition();
+       // Support: IE<=11
+       // IE requires us to defer before restoring the scroll position
+       setTimeout( function () {
+               target.restoreScrollPosition();
+       } );
 
        // Parent method
        ve.init.mw.DesktopArticleTarget.super.prototype.surfaceReady.apply( 
this, arguments );
@@ -1037,7 +1041,7 @@
  * Restore the window's scroll position.
  */
 ve.init.mw.DesktopArticleTarget.prototype.restoreScrollPosition = function () {
-       if ( this.scrollTop ) {
+       if ( this.scrollTop !== null ) {
                $( window ).scrollTop( this.scrollTop );
                this.scrollTop = null;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/284344
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id48b913effe5313c193ce62b19faf5655278ff6d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to