RCLFilters: make sticky filters default and current value equal
authorStephane Bisson <sbisson@wikimedia.org>
Mon, 12 Feb 2018 16:35:19 +0000 (11:35 -0500)
committerStephane Bisson <sbisson@wikimedia.org>
Mon, 12 Feb 2018 16:35:19 +0000 (11:35 -0500)
Bug: T186930
Change-Id: I6d2f5bd4b979fd1b66f3e37b8757daf93dd8b4a9

resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterGroup.js

index bb29b36..eda8c0d 100644 (file)
                        }
                }
 
+               if ( this.isSticky() ) {
+                       // If this group is sticky, then change the default according to the
+                       // current selection.
+                       this.defaultParams = this.getParamRepresentation( this.getSelectedState() );
+               }
+
                if (
                        changed ||
                        this.active !== active ||
                        this.currSelected !== item
                ) {
-                       if ( this.isSticky() ) {
-                               // If this group is sticky, then change the default according to the
-                               // current selection.
-                               this.defaultParams = this.getParamRepresentation( this.getSelectedState() );
-                       }
-
                        this.active = active;
                        this.currSelected = item;