new StateModel()
Models the state of a contextual link's trigger, list & region.
Extends
- Backbone.Model
Members
defaults :object
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
title |
string | |
regionIsHovered |
bool | |
hasFocus |
bool | |
isOpen |
bool | |
isLocked |
bool |
hasFocus :bool
Represents if the contextual trigger or options have focus.
Type:
- bool
isLocked :bool
When the model is locked, the trigger remains active.
Type:
- bool
isOpen :bool
Represents if the contextual options for an entity are available to be selected (i.e. whether the list of options is visible).
Type:
- bool
regionIsHovered :bool
Represents if the contextual region is being hovered.
Type:
- bool
title :string
The title of the entity to which these contextual links apply.
Type:
- string
Methods
blur() → {Drupal.contextual.StateModel}
Removes focus from this contextual link, unless it is open.
Returns:
The current contextual state model.
close() → {Drupal.contextual.StateModel}
Closes this contextual link.
Does not call blur() because we want to allow a contextual link to have focus, yet be closed for example when hovering.
Returns:
The current contextual state model.
focus() → {Drupal.contextual.StateModel}
Gives focus to this contextual link.
Also closes + removes focus from every other contextual link.
Returns:
The current contextual state model.
toggleOpen() → {Drupal.contextual.StateModel}
Opens or closes the contextual link.
If it is opened, then also give focus.
Returns:
The current contextual state model.