Merge "RCFilters: Only selectively scroll to popup when it's focused"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FilterTagMultiselectWidget.js
index f837b4a..df3263a 100644 (file)
                                click: 'onSaveQueryButtonClick',
                                saveCurrent: 'setSavedQueryVisibility'
                        } );
-                       this.queriesModel.connect( this, { itemUpdate: 'onSavedQueriesItemUpdate' } );
+                       this.queriesModel.connect( this, {
+                               itemUpdate: 'onSavedQueriesItemUpdate',
+                               initialize: 'onSavedQueriesInitialize'
+                       } );
                }
 
                this.emptyFilterMessage = new OO.ui.LabelWidget( {
                this.getMenu().toggle( false );
        };
 
+       /**
+        * Respond to save query model initialization
+        */
+       mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.onSavedQueriesInitialize = function () {
+               this.setSavedQueryVisibility();
+       };
+
        /**
         * Respond to save query item change. Mainly this is done to update the label in case
         * a query item has been edited
                        this.matchingQuery ? this.matchingQuery.getLabel() : ''
                );
                this.savedQueryTitle.toggle( !!this.matchingQuery );
-               this.saveQueryButton.toggle(
-                       !this.isEmpty() &&
-                       !this.matchingQuery
-               );
+               this.saveQueryButton.toggle( !this.matchingQuery );
 
                if ( this.matchingQuery ) {
                        this.emphasize();