}
}, config ) );
- this.positioned = false;
this.popupTimeoutShow = null;
this.popupTimeoutHide = null;
this.$highlight = $( '<div>' )
.addClass( 'mw-rcfilters-ui-tagItemWidget-highlight' );
+ // Add title attribute with the item label to 'x' button
+ this.closeButton.setTitle( mw.msg( 'rcfilters-tag-remove', this.model.getLabel() ) );
+
// Events
this.model.connect( this, { update: 'onModelUpdate' } );
if ( labelText ) {
this.popupLabel.setLabel( labelText );
- if ( !this.positioned ) {
- // Recalculate anchor position to be center of the capsule item
- this.popup.$anchor.css( 'margin-left', ( this.$element.width() / 2 ) );
- this.positioned = true;
- }
-
// Set timeout for the popup to show
this.popupTimeoutShow = setTimeout( function () {
this.popup.toggle( true );