3 * A popup containing a color picker, for setting highlight colors.
5 * @extends OO.ui.PopupWidget
8 * @param {mw.rcfilters.Controller} controller RCFilters controller
9 * @param {Object} [config] Configuration object
11 mw
.rcfilters
.ui
.HighlightPopupWidget
= function MwRcfiltersUiHighlightPopupWidget( controller
, config
) {
12 config
= config
|| {};
15 mw
.rcfilters
.ui
.HighlightPopupWidget
.parent
.call( this, $.extend( {
20 horizontalPosition
: 'end',
24 this.colorPicker
= new mw
.rcfilters
.ui
.HighlightColorPickerWidget( controller
);
26 this.colorPicker
.connect( this, { chooseColor
: 'onChooseColor' } );
28 this.$body
.append( this.colorPicker
.$element
);
33 OO
.inheritClass( mw
.rcfilters
.ui
.HighlightPopupWidget
, OO
.ui
.PopupWidget
);
38 * Set the button (or other widget) that this popup should hang off.
40 * @param {OO.ui.Widget} widget Widget the popup should orient itself to
42 mw
.rcfilters
.ui
.HighlightPopupWidget
.prototype.setAssociatedButton = function ( widget
) {
43 this.setFloatableContainer( widget
.$element
);
44 this.$autoCloseIgnore
= widget
.$element
;
48 * Set the filter item that this popup should control the highlight color for.
50 * @param {mw.rcfilters.dm.FilterItem} item
52 mw
.rcfilters
.ui
.HighlightPopupWidget
.prototype.setFilterItem = function ( item
) {
53 this.colorPicker
.setFilterItem( item
);
57 * When the user chooses a color in the color picker, close the popup.
59 mw
.rcfilters
.ui
.HighlightPopupWidget
.prototype.onChooseColor = function () {