RCFilters UI: Reassess interaction after resetting filters
authorMoriel Schottlender <moriel@gmail.com>
Thu, 23 Feb 2017 18:06:58 +0000 (10:06 -0800)
committerCatrope <roan@wikimedia.org>
Fri, 24 Feb 2017 00:40:01 +0000 (00:40 +0000)
Both resetting to defaults or resetting to no-filters state should
retrigger the interaction assessment so all filters should get their
included, fullyCovered and conflicted states resetted.

Bug: T158135
Change-Id: Iae23129b7fb378adb712b34e8e64208bbb70ccd7

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

index 3ba4dc0..1df31a2 100644 (file)
@@ -59,6 +59,9 @@
         */
        mw.rcfilters.Controller.prototype.resetToDefaults = function () {
                this.filtersModel.setFiltersToDefaults();
+               // Check all filter interactions
+               this.filtersModel.reassessFilterInteractions();
+
                this.updateURL();
                this.updateChangesList();
        };
@@ -69,6 +72,9 @@
        mw.rcfilters.Controller.prototype.emptyFilters = function () {
                this.filtersModel.emptyAllFilters();
                this.filtersModel.clearAllHighlightColors();
+               // Check all filter interactions
+               this.filtersModel.reassessFilterInteractions();
+
                this.updateURL();
                this.updateChangesList();
        };