Merge "Revert "RCFilters: Don't apply/clear highlights 66 times""
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 2 Oct 2017 18:34:38 +0000 (18:34 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 2 Oct 2017 18:34:38 +0000 (18:34 +0000)
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js

index fdea5ef..3b882a6 100644 (file)
                enable = enable === undefined ? !this.highlightEnabled : enable;
 
                if ( this.highlightEnabled !== enable ) {
-                       // HACK make sure highlights are disabled globally while we toggle on the items,
-                       // otherwise we'll call clearHighlight() and applyHighlight() many many times
-                       this.highlightEnabled = false;
+                       this.highlightEnabled = enable;
+
                        this.getItems().forEach( function ( filterItem ) {
                                filterItem.toggleHighlight( this.highlightEnabled );
                        }.bind( this ) );
 
-                       this.highlightEnabled = enable;
                        this.emit( 'highlightChange', this.highlightEnabled );
                }
        };