)
)
);
+ $config['namespace']['dropdown']['$overlay'] = true;
return parent::getConfig( $config );
}
}
public function getConfig( &$config ) {
$config['namespace'] = $this->config['namespace'];
+ $config['namespace']['dropdown']['$overlay'] = true;
$config['title'] = $this->config['title'];
+ $config['title']['$overlay'] = true;
return parent::getConfig( $config );
}
}
protected $precision = null;
protected $mustBeAfter = null;
protected $mustBeBefore = null;
- protected $overlay = null;
/**
* @param array $config Configuration options
* In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on `precision`.
* @param string $config['mustBeBefore'] Validates the date to be before this.
* In the 'YYYY-MM-DD' or 'YYYY-MM' format, depending on `precision`.
- * @param string $config['overlay'] The jQuery selector for the overlay layer on which to render
- * the calendar. This configuration is useful in cases where the expanded calendar is larger
- * than its container. The specified overlay layer is usually on top of the container and has
- * a larger area. Applicable only if the widget is infused. By default, the calendar uses
- * relative positioning.
*/
public function __construct( array $config = [] ) {
$config = array_merge( [
if ( isset( $config['placeholderLabel'] ) ) {
$this->placeholderLabel = $config['placeholderLabel'];
}
- if ( isset( $config['overlay'] ) ) {
- $this->overlay = $config['overlay'];
- }
// Set up placeholder text visible if the browser doesn't override it (logic taken from JS)
if ( $this->placeholderDateFormat !== null ) {
if ( $this->mustBeBefore !== null ) {
$config['mustBeBefore'] = $this->mustBeBefore;
}
- if ( $this->overlay !== null ) {
- $config['overlay'] = $this->overlay;
- }
+ $config['$overlay'] = true;
return parent::getConfig( $config );
}
$config['includeAllValue'] = $this->includeAllValue;
$config['exclude'] = $this->exclude;
// Skip DropdownInputWidget's getConfig(), we don't need 'options' config
+ $config['dropdown']['$overlay'] = true;
return \OOUI\InputWidget::getConfig( $config );
}
}
if ( $this->dataLocation ) {
$config['dataLocation'] = $this->dataLocation;
}
+ $config['$overlay'] = true;
return parent::getConfig( $config );
}
}
public function getConfig( &$config ) {
$config['textinput'] = $this->config['textinput'];
$config['dropdowninput'] = $this->config['dropdowninput'];
+ $config['dropdowninput']['dropdown']['$overlay'] = true;
$config['or'] = $this->config['or'];
return parent::getConfig( $config );
}
if ( $this->validateTitle !== null ) {
$config['validateTitle'] = $this->validateTitle;
}
+ $config['$overlay'] = true;
return parent::getConfig( $config );
}
}
protected function getJavaScriptClassName() {
return 'mw.widgets.UserInputWidget';
}
+
+ public function getConfig( &$config ) {
+ $config['$overlay'] = true;
+ return parent::getConfig( $config );
+ }
}
$config['placeholder'] = $this->inputPlaceholder;
}
+ $config['$overlay'] = true;
return parent::getConfig( $config );
}
* calendar uses relative positioning.
*/
mw.widgets.DateInputWidget = function MWWDateInputWidget( config ) {
- var placeholderDateFormat, mustBeAfter, mustBeBefore;
+ var placeholderDateFormat, mustBeAfter, mustBeBefore, $overlay;
// Config initialization
config = $.extend( {
.addClass( 'mw-widget-dateInputWidget' )
.append( this.$handle, this.textInput.$element, this.calendar.$element );
- // config.overlay is the selector to be used for config.$overlay, specified from PHP
- if ( config.overlay ) {
- config.$overlay = $( config.overlay );
- }
+ $overlay = config.$overlay === true ? OO.ui.getDefaultOverlay() : config.$overlay;
- if ( config.$overlay ) {
+ if ( $overlay ) {
this.calendar.setFloatableContainer( this.$element );
- config.$overlay.append( this.calendar.$element );
+ $overlay.append( this.calendar.$element );
// The text input and calendar are not in DOM order, so fix up focus transitions.
this.textInput.$input.on( 'keydown', function ( e ) {
} );
} );
capsulesWidget = new OO.ui.CapsuleMultiselectWidget( {
+ $overlay: true,
menu: {
items: capsulesOptions
}