RCFilters: Unsticky the 'limit' preference temporarily
authorMoriel Schottlender <moriel@gmail.com>
Tue, 1 Aug 2017 21:04:04 +0000 (14:04 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Tue, 1 Aug 2017 22:47:53 +0000 (15:47 -0700)
Bug: T172156
Bug: T171514
Change-Id: I0bed6de70655a4a8a90ceb2f900ffbe98e643d33

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

index 4051eda..9d2c331 100644 (file)
                                        validate: $.isNumeric,
                                        sortFunc: function ( a, b ) { return Number( a.name ) - Number( b.name ); },
                                        'default': String( limitDefault ),
-                                       isSticky: true,
+                                       // Temporarily making this not sticky until we resolve the problem
+                                       // with the misleading preference. Note that if this is to be permanent
+                                       // we should remove all sticky behavior methods completely
+                                       // See T172156
+                                       // isSticky: true,
                                        filters: [ 50, 100, 250, 500 ].map( function ( num ) {
                                                return controller._createFilterDataFromNumber( num, num );
                                        } )
                                                        Number( i );
                                        },
                                        'default': mw.user.options.get( 'rcdays', '30' ),
-                                       isSticky: true,
+                                       // Temporarily making this not sticky while limit is not sticky, see above
+                                       // isSticky: true,
                                        filters: [
                                                // Hours (1, 2, 6, 12)
                                                0.04166, 0.0833, 0.25, 0.5,
        /**
         * Update the limit default value
         *
-        * @param {number} newValue New value
+        * param {number} newValue New value
         */
-       mw.rcfilters.Controller.prototype.updateLimitDefault = function ( newValue ) {
+       mw.rcfilters.Controller.prototype.updateLimitDefault = function ( /* newValue */ ) {
+               // HACK: Temporarily remove this from being sticky
+               // See T172156
+
+               /*
                if ( !$.isNumeric( newValue ) ) {
                        return;
                }
                        // Update the preference for this session
                        mw.user.options.set( 'rcfilters-rclimit', newValue );
                }
+               */
+               return;
        };
 
        /**
         * Update the days default value
         *
-        * @param {number} newValue New value
+        * param {number} newValue New value
         */
-       mw.rcfilters.Controller.prototype.updateDaysDefault = function ( newValue ) {
+       mw.rcfilters.Controller.prototype.updateDaysDefault = function ( /* newValue */ ) {
+               // HACK: Temporarily remove this from being sticky
+               // See T172156
+
+               /*
                if ( !$.isNumeric( newValue ) ) {
                        return;
                }
                        // Update the preference for this session
                        mw.user.options.set( 'rcdays', newValue );
                }
+               */
+               return;
        };
 
        /**