Merge "RCFilters: Change to the new views redesign"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / mw.rcfilters.Controller.js
index 20f28b3..ebf2201 100644 (file)
         * @param {string} queryID Query id
         */
        mw.rcfilters.Controller.prototype.removeSavedQuery = function ( queryID ) {
-               var query = this.savedQueriesModel.getItemByID( queryID );
+               this.savedQueriesModel.removeQuery( queryID );
 
-               this.savedQueriesModel.removeItems( [ query ] );
-
-               // Check if this item was the default
-               if ( this.savedQueriesModel.getDefault() === queryID ) {
-                       // Nulify the default
-                       this.savedQueriesModel.setDefault( null );
-               }
                this._saveSavedQueries();
        };
 
                        this.uriProcessor.getVersion( currentUri.query ) !== 2 ||
                        this.uriProcessor.isNewState( currentUri.query, updatedUri.query )
                ) {
-                       if ( this.initializing ) {
-                               // Initially, when we just build the first page load
-                               // out of defaults, we want to replace the history
-                               mw.rcfilters.UriProcessor.static.replaceState( updatedUri );
-                       } else {
-                               mw.rcfilters.UriProcessor.static.pushState( updatedUri );
-                       }
+                       mw.rcfilters.UriProcessor.static.replaceState( updatedUri );
                }
        };