Merge "Skin: Make skins aware of their registered skin name"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FilterItemHighlightButton.js
index 616608e..c840d7c 100644 (file)
                        icon: 'highlight',
                        indicator: 'down',
                        popup: {
-                               // TODO: There is a bug in non-anchored popups in
-                               // OOUI, so we set this popup to "anchored" until
-                               // the bug is fixed.
-                               // See: https://phabricator.wikimedia.org/T159906
-                               anchor: true,
+                               anchor: false,
                                padded: true,
                                align: 'backwards',
                                horizontalPosition: 'end',
                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' );
        };
@@ -56,7 +54,6 @@
 
        /**
         * @static
-        * @inheritdoc
         */
        mw.rcfilters.ui.FilterItemHighlightButton.static.cancelButtonMouseDownEvents = true;
 
@@ -65,7 +62,7 @@
        /**
         * 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;