Merge "Enable jsduck for resources/src/mediawiki.rcfilters and make pass"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FilterTagMultiselectWidget.js
index 305456a..ac22258 100644 (file)
@@ -2,6 +2,7 @@
        /**
         * List displaying all filter groups
         *
+        * @class
         * @extends OO.ui.MenuTagMultiselectWidget
         * @mixins OO.ui.mixin.PendingElement
         *
        };
 
        /**
-        * @inheridoc
+        * @inheritdoc
         */
        mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.onChangeTags = function () {
                // Parent method
                                !this.isEmpty() &&
                                !this.matchingQuery
                        );
+
+                       if ( this.matchingQuery ) {
+                               this.emphasize();
+                       }
                }
        };
 
         * @param {mw.rcfilters.dm.FilterItem} item Filter item model
         */
        mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.onModelItemUpdate = function ( item ) {
+               if ( item.getGroupModel().isHidden() ) {
+                       return;
+               }
+
                if (
                        item.isSelected() ||
                        (
                }
        };
 
+       mw.rcfilters.ui.FilterTagMultiselectWidget.prototype.emphasize = function () {
+               if (
+                       !this.$handle.hasClass( 'mw-rcfilters-ui-filterTagMultiselectWidget-animate' )
+               ) {
+                       this.$handle
+                               .addClass( 'mw-rcfilters-ui-filterTagMultiselectWidget-emphasize' )
+                               .addClass( 'mw-rcfilters-ui-filterTagMultiselectWidget-animate' );
+
+                       setTimeout( function () {
+                               this.$handle
+                                       .removeClass( 'mw-rcfilters-ui-filterTagMultiselectWidget-emphasize' );
+
+                               setTimeout( function () {
+                                       this.$handle
+                                               .removeClass( 'mw-rcfilters-ui-filterTagMultiselectWidget-animate' );
+                               }.bind( this ), 1000 );
+                       }.bind( this ), 500 );
+
+               }
+       };
        /**
         * Scroll the element to top within its container
         *