Constructor
new OO.ui.mixin.AccessKeyedElement([config])abstract
#
AccessKeyedElement is mixed into other classes to provide an accesskey
HTML attribute.
Access keys 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.
Example
// AccessKeyedElement provides an `accesskey` attribute to the
// ButtonWidget class.
const button = new OO.ui.ButtonWidget( {
label: 'Button with access key',
accessKey: 'k'
} );
$( document.body ).append( button.$element );
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
optional |
Configuration options Properties:
|
- Source:
accesskey
HTML attribute.
Properties
accessKeystatic
#
The access key, a function that returns a key, or null
for no access key.
Properties:
Type | Description |
---|---|
string
|
function
|
null
|
- Source:
null
for no access key.
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 |
- Source:
Returns:
- Type
- string
getAccessKey() → {string}
#
Get access key.
- Source:
Returns:
accessKey string
- Type
- string
setAccessKey(accessKey) → {OO.ui.Element}chainable
#
Set access key.
Parameters:
Name | Type | Description |
---|---|---|
accessKey |
string
|
function
|
null
|
Key, a function that returns a key, or |
- Source:
Returns:
The element, for chaining
- Type
- OO.ui.Element
setAccessKeyedElement($accessKeyed)
#
Set the access keyed 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 'access keyed' functionality |
- Source: