this.model = model;
// Event
- this.model.connect( this, { update: 'onModelUpdate' } );
+ this.model.connect( this, { update: 'updateUiBasedOnModel' } );
this.colorPickerWidget.connect( this, { chooseColor: 'onChooseColor' } );
// This lives inside a MenuOptionWidget, which intercepts mousedown
// to select the item. We want to prevent that when we click the highlight
// button
this.$element.on( 'mousedown', function ( e ) { e.stopPropagation(); } );
+ this.updateUiBasedOnModel();
+
this.$element
.addClass( 'mw-rcfilters-ui-filterItemHighlightButton' );
};
/**
* @static
- * @inheritdoc
*/
mw.rcfilters.ui.FilterItemHighlightButton.static.cancelButtonMouseDownEvents = true;
/**
* Respond to item model update event
*/
- mw.rcfilters.ui.FilterItemHighlightButton.prototype.onModelUpdate = function () {
+ mw.rcfilters.ui.FilterItemHighlightButton.prototype.updateUiBasedOnModel = function () {
var currentColor = this.model.getHighlightColor(),
widget = this;