Mixin: AccessKeyedElement

.ui.mixin.AccessKeyedElement

AccessKeyedElement is mixed into other classes to provide an accesskey attribute. Accesskeys allow an user to go to a specific element by using a shortcut combination of a browser specific keys + the key set to the field.

Source:

Example

// AccessKeyedElement provides an 'accesskey' attribute to the
    // ButtonWidget class
    var button = new OO.ui.ButtonWidget( {
        label: 'Button with Accesskey',
        accessKey: 'k'
    } );
    $( 'body' ).append( button.$element );

Methods

formatTitleWithAccessKey(title) → {string}

Add information about the access key to the element's tooltip label. (This is only public for hacky usage in FieldLayout.)

Parameters:
Name Type Description
title string

Tooltip label for title attribute

Source:
Returns:
Type
string

getAccessKey() → {string}

Get accesskey.

Source:
Returns:

accessKey string

Type
string

setAccessKey(accessKey)

Set accesskey.

Parameters:
Name Type Description
accessKey string | function | null

Key, a function that returns a key, or null for no accesskey

Source:

setAccessKeyedElement($accessKeyed)

Set the accesskeyed element.

This method is used to retarget a AccessKeyedElement mixin so that its functionality applies to the specified element. If an element is already set, the mixin's effect on that element is removed before the new element is set up.

Parameters:
Name Type Description
$accessKeyed jQuery

Element that should use the 'accesskeyes' functionality

Source: