mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Merge "Defer before restoring scroll position, and allow 0"
This commit is contained in:
commit
0f60df5d9e
|
@ -662,7 +662,11 @@ ve.init.mw.DesktopArticleTarget.prototype.surfaceReady = function () {
|
||||||
|
|
||||||
// Update UI
|
// Update UI
|
||||||
this.changeDocumentTitle();
|
this.changeDocumentTitle();
|
||||||
this.restoreScrollPosition();
|
// Support: IE<=11
|
||||||
|
// IE requires us to defer before restoring the scroll position
|
||||||
|
setTimeout( function () {
|
||||||
|
target.restoreScrollPosition();
|
||||||
|
} );
|
||||||
|
|
||||||
// Parent method
|
// Parent method
|
||||||
ve.init.mw.DesktopArticleTarget.super.prototype.surfaceReady.apply( this, arguments );
|
ve.init.mw.DesktopArticleTarget.super.prototype.surfaceReady.apply( this, arguments );
|
||||||
|
@ -1037,7 +1041,7 @@ ve.init.mw.DesktopArticleTarget.prototype.saveScrollPosition = function () {
|
||||||
* Restore the window's scroll position.
|
* Restore the window's scroll position.
|
||||||
*/
|
*/
|
||||||
ve.init.mw.DesktopArticleTarget.prototype.restoreScrollPosition = function () {
|
ve.init.mw.DesktopArticleTarget.prototype.restoreScrollPosition = function () {
|
||||||
if ( this.scrollTop ) {
|
if ( this.scrollTop !== null ) {
|
||||||
$( window ).scrollTop( this.scrollTop );
|
$( window ).scrollTop( this.scrollTop );
|
||||||
this.scrollTop = null;
|
this.scrollTop = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue