Do not await related changes to scroll to the linked message

With I9ac798d8dd and following work, the related changes section no
longer causes layout jank. As such, the scroll-offset initialization no
longer needs to await related changes having loaded and can be executed
in parallel.

Bug: Issue 6668
Change-Id: I85429b4d7c0ef461afe89ae2036105db81f60c6c
This commit is contained in:
Wyatt Allen
2017-07-06 17:19:27 -07:00
parent 7fe1ac89a9
commit e35bba2018

View File

@@ -472,24 +472,8 @@
},
_performPostLoadTasks() {
// Allow the message list and related changes to render before scrolling.
// Related changes are loaded here (after everything else) because they
// take the longest and are secondary information. Because the element may
// alter the total height of the page, the call to potentially scroll to
// a linked message is performed after related changes is fully loaded.
this.$.relatedChanges.reload().then(() => {
this.async(() => {
if (this.viewState.scrollTop) {
document.documentElement.scrollTop =
document.body.scrollTop = this.viewState.scrollTop;
} else {
this._maybeScrollToMessage(window.location.hash);
}
}, 1);
});
this.$.relatedChanges.reload();
this._maybeShowReplyDialog();
this._maybeShowRevertDialog();
this.$.jsAPI.handleEvent(this.$.jsAPI.EventType.SHOW_CHANGE, {
@@ -497,7 +481,15 @@
patchNum: this._patchRange.patchNum,
});
this._initialLoadComplete = true;
this.async(() => {
if (this.viewState.scrollTop) {
document.documentElement.scrollTop =
document.body.scrollTop = this.viewState.scrollTop;
} else {
this._maybeScrollToMessage(window.location.hash);
}
this._initialLoadComplete = true;
});
},
_paramsAndChangeChanged(value) {