Merge "DateTimeInputWidget: Only show calendar when focusing date components, not...
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets.datetime / DateTimeInputWidget.js
index de24942..3e4c5e2 100644 (file)
                        calendar: {}
                }, config );
 
+               // See InputWidget#reusePreInfuseDOM about config.$input
+               if ( config.$input ) {
+                       config.$input.addClass( 'oo-ui-element-hidden' );
+               }
+
                if ( $.isPlainObject( config.formatter ) && config.formatter.format === undefined ) {
                        config.formatter.format = '@' + config.type;
                }
 
        /* Static properties */
 
-       mw.widgets.datetime.DateTimeInputWidget[ 'static' ].supportsSimpleLabel = false;
+       mw.widgets.datetime.DateTimeInputWidget.static.supportsSimpleLabel = false;
 
        /* Events */
 
         * @private
         * @param {jQuery} $field
         * @param {jQuery.Event} e Key down event
+        * @return {boolean} False to cancel the default event
         */
        mw.widgets.datetime.DateTimeInputWidget.prototype.onFieldKeyDown = function ( $field, e ) {
                var spec = $field.data( 'mw-widgets-datetime-dateTimeInputWidget-fieldSpec' );
         * @private
         * @param {jQuery} $field
         * @param {jQuery.Event} e Change event
+        * @return {boolean} False to cancel the default event
         */
        mw.widgets.datetime.DateTimeInputWidget.prototype.onFieldWheel = function ( $field, e ) {
                var delta = 0,