Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381823 )

Change subject: Reapply "RCFilters: Don't apply/clear highlights 66 times"
......................................................................

Reapply "RCFilters: Don't apply/clear highlights 66 times"

Reverts 84ddcd5d23, reapplies 212d67c67.

The original version broke the highlight color circles, this fixes it
by using enable instead of this.highlightEnabled to pass down to the
items. The former was always false, so it didn't actually propagate
the state down correctly.

Bug: T177107
Change-Id: I341d9bcd39252eac07bfebfa6d46895bc62c372f
---
M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/381823/1

diff --git 
a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js 
b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
index 3b882a6..edb3d0f 100644
--- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
+++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
@@ -1026,12 +1026,14 @@
                enable = enable === undefined ? !this.highlightEnabled : enable;
 
                if ( this.highlightEnabled !== enable ) {
-                       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.getItems().forEach( function ( filterItem ) {
-                               filterItem.toggleHighlight( 
this.highlightEnabled );
-                       }.bind( this ) );
+                               filterItem.toggleHighlight( enable );
+                       } );
 
+                       this.highlightEnabled = enable;
                        this.emit( 'highlightChange', this.highlightEnabled );
                }
        };

-- 
To view, visit https://gerrit.wikimedia.org/r/381823
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I341d9bcd39252eac07bfebfa6d46895bc62c372f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to