| 1 |
const HighlightColorPickerWidget = require( './HighlightColorPickerWidget.js' ); |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
const HighlightPopupWidget = function MwRcfiltersUiHighlightPopupWidget( controller, config ) { |
| 13 |
config = config || {}; |
| 14 |
|
| 15 |
|
| 16 |
HighlightPopupWidget.super.call( this, Object.assign( { |
| 17 |
autoClose: true, |
| 18 |
anchor: false, |
| 19 |
padded: true, |
| 20 |
align: 'backwards', |
| 21 |
horizontalPosition: 'end', |
| 22 |
width: 290 |
| 23 |
}, config ) ); |
| 24 |
|
| 25 |
this.colorPicker = new HighlightColorPickerWidget( controller ); |
| 26 |
|
| 27 |
this.colorPicker.connect( this, { chooseColor: 'onChooseColor' } ); |
| 28 |
|
| 29 |
this.$body.append( this.colorPicker.$element ); |
| 30 |
}; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
OO.inheritClass( HighlightPopupWidget, OO.ui.PopupWidget ); |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
HighlightPopupWidget.prototype.setAssociatedButton = function ( widget ) { |
| 44 |
this.setFloatableContainer( widget.$element ); |
| 45 |
this.$autoCloseIgnore = widget.$element; |
| 46 |
}; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
HighlightPopupWidget.prototype.setFilterItem = function ( item ) { |
| 54 |
this.colorPicker.setFilterItem( item ); |
| 55 |
}; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
HighlightPopupWidget.prototype.onChooseColor = function () { |
| 61 |
this.toggle( false ); |
| 62 |
}; |
| 63 |
|
| 64 |
module.exports = HighlightPopupWidget; |