RCFilters: Update URL even when we skip fetching
authorMoriel Schottlender <moriel@gmail.com>
Wed, 22 Nov 2017 00:37:32 +0000 (16:37 -0800)
committerMoriel Schottlender <moriel@gmail.com>
Wed, 22 Nov 2017 00:37:32 +0000 (16:37 -0800)
In some cases, when the selected value of the filters have not
changed, we don't reload the results. However, we should still
update the URL values.

Change-Id: Iff81b4ca1b78848813b2eb8d55f0f5f5e614b424

resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js

index 5386291..0cec3ff 100644 (file)
         * Reset to default filters
         */
        mw.rcfilters.Controller.prototype.resetToDefaults = function () {
-               if ( this.applyParamChange( this._getDefaultParams() ) ) {
+               var params = this._getDefaultParams();
+               if ( this.applyParamChange( params ) ) {
                        // Only update the changes list if there was a change to actual filters
                        this.updateChangesList();
+               } else {
+                       this.uriProcessor.updateURL( params );
                }
        };
 
                if ( this.applyParamChange( {} ) ) {
                        // Only update the changes list if there was a change to actual filters
                        this.updateChangesList();
+               } else {
+                       this.uriProcessor.updateURL();
                }
 
                if ( highlightedFilterNames ) {
                if ( this.applyParamChange( params ) ) {
                        // Update changes list only if there was a difference in filter selection
                        this.updateChangesList();
+               } else {
+                       this.uriProcessor.updateURL( params );
                }
 
                // Log filter grouping