RCFilters: Allows specifying default highlights from the server
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / dm / mw.rcfilters.dm.ItemModel.js
index aa82e21..9c56f09 100644 (file)
@@ -21,6 +21,7 @@
         * @cfg {string} [cssClass] The class identifying the results that match this filter
         * @cfg {string[]} [identifiers] An array of identifiers for this item. They will be
         *  added and considered in the view.
+        * @cfg {string} [defaultHighlightColor] If set, highlight this filter by default with this color
         */
        mw.rcfilters.dm.ItemModel = function MwRcfiltersDmItemModel( param, config ) {
                config = config || {};
@@ -42,8 +43,8 @@
 
                // Highlight
                this.cssClass = config.cssClass;
-               this.highlightColor = null;
-               this.highlightEnabled = false;
+               this.highlightColor = config.defaultHighlightColor;
+               this.highlightEnabled = !!config.defaultHighlightColor;
        };
 
        /* Initialization */