Revert "RCFilters: Don't apply/clear highlights 66 times"
authorCatrope <roan@wikimedia.org>
Mon, 2 Oct 2017 18:24:33 +0000 (18:24 +0000)
committerCatrope <roan@wikimedia.org>
Mon, 2 Oct 2017 18:24:33 +0000 (18:24 +0000)
Breaks highlight display

This reverts commit 212d67c67e153f95fd2eb49a75b7ece27d794b53.

Change-Id: Ia0111bd35a40df56122a5b8c483de1be35609911

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 );
                }
        };