From 89ace728a4cbc5bae9a53bc8e426289faa0bb32d Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Tue, 2 Aug 2022 13:23:34 +0200 Subject: [PATCH] Chain scroll calls instead of just calling after each other Change-Id: I420fbd29ab79d6f2e1e9ef02bc3c99050126c3c8 --- .../ve.ui.MWTransclusionOutlineTemplateWidget.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js index 106ff62cf4..6fbe7ab5b5 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineTemplateWidget.js @@ -469,9 +469,11 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onToggleUnusedFields = funct } if ( !visibility && fromClick ) { - this.header.scrollElementIntoView(); - if ( this.parameterList ) { - this.parameterList.ensureVisibilityOfFirstCheckedParameter(); - } + var self = this; + this.header.scrollElementIntoView().then( function () { + if ( self.parameterList ) { + self.parameterList.ensureVisibilityOfFirstCheckedParameter(); + } + } ); } };