# all files / src/widgets/ MenuOptionWidget.js

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

    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

    1×

    1409×

    1409×

    1×

    1×
     /**
     * MenuOptionWidget is an option widget that looks like a menu item. The class is used with
     * OO.ui.MenuSelectWidget to create a menu of mutually exclusive options. Please see
     * the [OOjs UI documentation on MediaWiki] [1] for more information.
     *
     * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Selects_and_Options#Menu_selects_and_options
     *
     * @class
     * @extends OO.ui.DecoratedOptionWidget
     *
     * @constructor
     * @param {Object} [config] Configuration options
     */
    OO.ui.MenuOptionWidget = function OoUiMenuOptionWidget( config ) {
    	// Parent constructor
    	OO.ui.MenuOptionWidget.parent.call( this, config );

    	// Initialization
    	this.$element.addClass( 'oo-ui-menuOptionWidget' );
    };

    /* Setup */

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

    /* Static Properties */

    /**
     * @static
     * @inheritdoc
     */
    OO.ui.MenuOptionWidget.static.scrollIntoViewOnSelect = true;