# all files / src/widgets/ MenuSectionOptionWidget.js

66.67% Statements 4/6
100% Branches 0/0
0% Functions 0/1
66.67% Lines 4/6

    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
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64

    1×

    1×

    1×

    1×
     /**
     * MenuSectionOptionWidgets are used inside {@link OO.ui.MenuSelectWidget menu select widgets} to group one or more related
     * {@link OO.ui.MenuOptionWidget menu options}. MenuSectionOptionWidgets cannot be highlighted or selected.
     *
     *     @example
     *     var myDropdown = new OO.ui.DropdownWidget( {
     *         menu: {
     *             items: [
     *                 new OO.ui.MenuSectionOptionWidget( {
     *                     label: 'Dogs'
     *                 } ),
     *                 new OO.ui.MenuOptionWidget( {
     *                     data: 'corgi',
     *                     label: 'Welsh Corgi'
     *                 } ),
     *                 new OO.ui.MenuOptionWidget( {
     *                     data: 'poodle',
     *                     label: 'Standard Poodle'
     *                 } ),
     *                 new OO.ui.MenuSectionOptionWidget( {
     *                     label: 'Cats'
     *                 } ),
     *                 new OO.ui.MenuOptionWidget( {
     *                     data: 'lion',
     *                     label: 'Lion'
     *                 } )
     *             ]
     *         }
     *     } );
     *     $( 'body' ).append( myDropdown.$element );
     *
     * @class
     * @extends OO.ui.DecoratedOptionWidget
     *
     * @constructor
     * @param {Object} [config] Configuration options
     */
    OO.ui.MenuSectionOptionWidget = function OoUiMenuSectionOptionWidget( config ) {
    	// Parent constructor
    	OO.ui.MenuSectionOptionWidget.parent.call( this, config );

    	// Initialization
    	this.$element.addClass( 'oo-ui-menuSectionOptionWidget' )
    		.removeAttr( 'role aria-selected' );
    };

    /* Setup */

    OO.inheritClass( OO.ui.MenuSectionOptionWidget, OO.ui.DecoratedOptionWidget );

    /* Static Properties */

    /**
     * @static
     * @inheritdoc
     */
    OO.ui.MenuSectionOptionWidget.static.selectable = false;

    /**
     * @static
     * @inheritdoc
     */
    OO.ui.MenuSectionOptionWidget.static.highlightable = false;