Merge "Invalidate cache when page language is changed"
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets.datetime / DateTimeInputWidget.js
index df148c7..01d3442 100644 (file)
@@ -55,6 +55,9 @@
                        config.formatter.format = '@' + config.type;
                }
 
+               // Early properties
+               this.type = config.type;
+
                // Parent constructor
                mw.widgets.datetime.DateTimeInputWidget[ 'super' ].call( this, config );
 
@@ -64,7 +67,6 @@
                OO.ui.mixin.PendingElement.call( this, config );
 
                // Properties
-               this.type = config.type;
                this.$handle = $( '<span>' );
                this.$fields = $( '<span>' );
                this.fields = [];
                                        if ( spec.intercalarySize ) {
                                                $.each( spec.intercalarySize, reduceFunc );
                                        }
-                                       $field = $( '<input type="text">' )
+                                       $field = $( '<input>' ).attr( 'type', 'text' )
                                                .attr( {
                                                        tabindex: disabled ? -1 : 0,
                                                        size: spec.size,
         * @private
         */
        mw.widgets.datetime.DateTimeInputWidget.prototype.getInputElement = function () {
-               return $( '<input type="hidden" />' );
+               return $( '<input>' ).attr( 'type', 'hidden' );
        };
 
        /**