-( 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 ) );
+}() );