Mixin: ButtonElement

.ui.mixin.ButtonElement

ButtonElement is often mixed into other classes to generate a button, which is a clickable interface element that can be configured with access keys for accessibility. See the [OOUI documentation on MediaWiki] [1] for examples. [1]: https://www.mediawiki.org/wiki/OOUI/Widgets/Buttons_and_Switches#Buttons
Source:

Methods

(protected) isActive() → {boolean}

Check if the button is active
Source:
Returns:
The button is active
Type
boolean

isFramed() → {boolean}

Check if button has a frame.
Source:
Returns:
Button is framed
Type
boolean

(protected) onClick(e)

Handles mouse click events.
Parameters:
Name Type Description
e jQuery.Event Mouse click event
Source:
Fires:

(protected) onKeyDown(e)

Handles key down events.
Parameters:
Name Type Description
e jQuery.Event Key down event
Source:

(protected) onKeyPress(e)

Handles key press events.
Parameters:
Name Type Description
e jQuery.Event Key press event
Source:
Fires:

(protected) onKeyUp(e)

Handles key up events.
Parameters:
Name Type Description
e KeyboardEvent Key up event
Source:

(protected) onMouseDown(e)

Handles mouse down events.
Parameters:
Name Type Description
e jQuery.Event Mouse down event
Source:

(protected) onMouseUp(e)

Handles mouse up events.
Parameters:
Name Type Description
e MouseEvent Mouse up event
Source:

(protected) setActive(value)

Set the button's active state. The active state can be set on: - ButtonOptionWidget when it is selected - ToggleButtonWidget when it is toggle on - ButtonWidget when clicking the button would only refresh the page
Parameters:
Name Type Description
value boolean Make button active
Source:

setButtonElement($button)

Set the button element. This method is used to retarget a button mixin so that its functionality applies to the specified button element instead of the one created by the class. If a button element is already set, the method will remove the mixin’s effect on that element.
Parameters:
Name Type Description
$button jQuery Element to use as button
Source:

toggleFramed(framedopt)

Render the button with or without a frame. Omit the `framed` parameter to toggle the button frame on and off.
Parameters:
Name Type Attributes Description
framed boolean <optional>
Make button framed, omit to toggle
Source: