# all files / src/widgets/ HiddenInputWidget.js

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 7/7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39

    1×

    60×

    60×

    60×

    60×

    1×

    1×
     /**
     * Data widget intended for creating 'hidden'-type inputs.
     *
     * @class
     * @extends OO.ui.Widget
     *
     * @constructor
     * @param {Object} [config] Configuration options
     * @cfg {string} [value=''] The value of the input.
     * @cfg {string} [name=''] The value of the input’s HTML `name` attribute.
     */
    OO.ui.HiddenInputWidget = function OoUiHiddenInputWidget( config ) {
    	// Configuration initialization
    	config = $.extend( { value: '', name: '' }, config );

    	// Parent constructor
    	OO.ui.HiddenInputWidget.parent.call( this, config );

    	// Initialization
    	this.$element.attr( {
    		type: 'hidden',
    		value: config.value,
    		name: config.name
    	} );
    	this.$element.removeAttr( 'aria-disabled' );
    };

    /* Setup */

    OO.inheritClass( OO.ui.HiddenInputWidget, OO.ui.Widget );

    /* Static Properties */

    /**
     * @static
     * @inheritdoc
     */
    OO.ui.HiddenInputWidget.static.tagName = 'input';