From bb15314f1b50b088594fe4eed5e0f26583a3ab92 Mon Sep 17 00:00:00 2001 From: Kosta Harlan Date: Thu, 28 Jun 2018 10:22:54 -0400 Subject: [PATCH] RC Filters: Check if app is initialized before calling change tags This only occurs when highlighting is enabled in the query parameters on page load. If you load a watchlist page with highlighting enabled, you'll see that FilterTagMultiselectWidget calls the parent onChangeTags method, and then we end up at updateIfHeightChanged where a resize event occurs. This commit checks to see if the app is still initializing before propagating this event. Bug: T198399 Change-Id: I8d36875ecf859b40854fe57fecf824e648bb3bf8 --- .../ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js index 907c5354a1..c7db7c6592 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js @@ -388,8 +388,10 @@ * @inheritdoc */ mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.onChangeTags = function () { - // Parent method - mw.rcfilters.ui.FilterTagMultiselectWidget.parent.prototype.onChangeTags.call( this ); + // If initialized, call parent method. + if ( this.controller.isInitialized() ) { + mw.rcfilters.ui.FilterTagMultiselectWidget.parent.prototype.onChangeTags.call( this ); + } this.emptyFilterMessage.toggle( this.isEmpty() ); }; -- 2.20.1