X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.widgets%2Fmw.widgets.DateInputWidget.js;h=c7502da547f75e2280104863fae07d110b5a672e;hb=d09d0cc568ad2a56360a3861ae9dba26d584ecc8;hp=9d2e93b8cf008eca818ffe77c833e49cb6627206;hpb=d84c3dde5af90c5c3497d18e427a5c2a38ac6ca8;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js b/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js index 9d2e93b8cf..c7502da547 100644 --- 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 */ -( function ( $, mw ) { +( function () { /** * Creates an mw.widgets.DateInputWidget object. @@ -89,7 +89,7 @@ * calendar uses relative positioning. */ mw.widgets.DateInputWidget = function MWWDateInputWidget( config ) { - var placeholderDateFormat, mustBeAfter, mustBeBefore; + var placeholderDateFormat, mustBeAfter, mustBeBefore, $overlay; // Config initialization config = $.extend( { @@ -189,14 +189,11 @@ .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 ) { @@ -695,4 +692,4 @@ } }; -}( jQuery, mediaWiki ) ); +}() );