dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add PHPUnit tests for methods in ViewAction::class"
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki.widgets
/
mw.widgets.DateInputWidget.js
diff --git
a/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js
b/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js
index
9d2e93b
..
c7502da
100644
(file)
--- a/
resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js
+++ b/
resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js
@@
-5,7
+5,7
@@
* @license The MIT License (MIT); see LICENSE.txt
*/
/* global moment */
* @license The MIT License (MIT); see LICENSE.txt
*/
/* global moment */
-( function (
$, mw
) {
+( function () {
/**
* Creates an mw.widgets.DateInputWidget object.
/**
* Creates an mw.widgets.DateInputWidget object.
@@
-89,7
+89,7
@@
* calendar uses relative positioning.
*/
mw.widgets.DateInputWidget = function MWWDateInputWidget( config ) {
* calendar uses relative positioning.
*/
mw.widgets.DateInputWidget = function MWWDateInputWidget( config ) {
- var placeholderDateFormat, mustBeAfter, mustBeBefore;
+ var placeholderDateFormat, mustBeAfter, mustBeBefore
, $overlay
;
// Config initialization
config = $.extend( {
// Config initialization
config = $.extend( {
@@
-189,14
+189,11
@@
.addClass( 'mw-widget-dateInputWidget' )
.append( this.$handle, this.textInput.$element, this.calendar.$element );
.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 );
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 ) {
// The text input and calendar are not in DOM order, so fix up focus transitions.
this.textInput.$input.on( 'keydown', function ( e ) {
@@
-695,4
+692,4
@@
}
};
}
};
-}(
jQuery, mediaWiki
) );
+}() );