# all files / src/widgets/ TabSelectWidget.js

42.86% Statements 3/7
100% Branches 0/0
0% Functions 0/1
42.86% Lines 3/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

    1×

    1×
    1×
     /**
     * TabSelectWidget is a list that contains {@link OO.ui.TabOptionWidget tab options}
     *
     * **Currently, this class is only used by {@link OO.ui.IndexLayout index layouts}.**
     *
     * @class
     * @extends OO.ui.SelectWidget
     * @mixins OO.ui.mixin.TabIndexedElement
     *
     * @constructor
     * @param {Object} [config] Configuration options
     */
    OO.ui.TabSelectWidget = function OoUiTabSelectWidget( config ) {
    	// Parent constructor
    	OO.ui.TabSelectWidget.parent.call( this, config );

    	// Mixin constructors
    	OO.ui.mixin.TabIndexedElement.call( this, config );

    	// Events
    	this.$element.on( {
    		focus: this.bindDocumentKeyDownListener.bind( this ),
    		blur: this.unbindDocumentKeyDownListener.bind( this )
    	} );

    	// Initialization
    	this.$element
    		.addClass( 'oo-ui-tabSelectWidget' )
    		.attr( 'role', 'tablist' );
    };

    /* Setup */

    OO.inheritClass( OO.ui.TabSelectWidget, OO.ui.SelectWidget );
    OO.mixinClass( OO.ui.TabSelectWidget, OO.ui.mixin.TabIndexedElement );