Merge "resources: Strip '$' and 'mw' from file closures"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.TagItemWidget.js
index 7e324b6..88117e7 100644 (file)
@@ -1,4 +1,4 @@
-( function ( mw, $ ) {
+( function () {
        /**
         * Extend OOUI's TagItemWidget to also display a popup on hover.
         *
         * Respond to model update event
         */
        mw.rcfilters.ui.TagItemWidget.prototype.updateUiBasedOnState = function () {
-               this.setCurrentMuteState();
-
                // Update label if needed
-               this.setLabel( $( '<div>' ).html( this.itemModel.getPrefixedLabel( this.invertModel.isSelected() ) ).contents() );
+               var labelMsg = this.itemModel.getLabelMessageKey( this.invertModel.isSelected() );
+               if ( labelMsg ) {
+                       this.setLabel( $( '<div>' ).append(
+                               $( '<bdi>' ).html(
+                                       mw.message( labelMsg, mw.html.escape( this.itemModel.getLabel() ) ).parse()
+                               )
+                       ).contents() );
+               } else {
+                       this.setLabel(
+                               $( '<bdi>' ).append(
+                                       this.itemModel.getLabel()
+                               )
+                       );
+               }
 
+               this.setCurrentMuteState();
                this.setHighlightColor();
        };
 
                this.itemModel.disconnect( this );
                this.closeButton.disconnect( this );
        };
-}( mediaWiki, jQuery ) );
+}() );