new EntityToolbarView(options)
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object | Options to construct the view. Properties
|
Extends
- Backbone.View
Members
_fieldToolbarRoot :jQuery
Type:
Methods
_find(toolgroup) → {jQuery}
Finds a toolgroup.
Parameters:
Name | Type | Description |
---|---|---|
toolgroup |
string | A toolgroup name. |
Returns:
The toolgroup DOM element.
- Type
- jQuery
addClass(toolgroup, classes)
Adds classes to a toolgroup.
Parameters:
Name | Type | Description |
---|---|---|
toolgroup |
string | A toolgroup name. |
classes |
string | A string of space-delimited class names that will be applied to the wrapping element of the toolbar group. |
buildToolbarEl() → {jQuery}
Builds the entity toolbar HTML; attaches to DOM; sets starting position.
Returns:
The toolbar element.
- Type
- jQuery
events() → {object}
Returns:
A map of events.
- Type
- object
fieldStateChange(model, state)
Determines the actions to take given a change of state.
Parameters:
Name | Type | Description |
---|---|---|
model |
Drupal.quickedit.FieldModel | The |
state |
string | The state of the associated field. One of
|
getToolbarRoot() → {jQuery}
Returns the DOM element that fields will attach their toolbars to.
Returns:
The DOM element that fields will attach their toolbars to.
- Type
- jQuery
label()
Generates a state-dependent label for the entity toolbar.
onClickCancel(event)
Sets the model state to candidate when the cancel button is clicked.
Parameters:
Name | Type | Description |
---|---|---|
event |
jQuery.Event | The click event. |
onClickSave(event)
Set the model state to 'saving' when the save button is clicked.
Parameters:
Name | Type | Description |
---|---|---|
event |
jQuery.Event | The click event. |
onMouseenter(event)
Clears the timeout that will eventually reposition the entity toolbar.
Without this, it may reposition itself, away from the user's cursor!
Parameters:
Name | Type | Description |
---|---|---|
event |
jQuery.Event | The mouse event. |
position(elementopt)
Uses the Popper() method to position the entity toolbar.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
element |
HTMLElement |
<optional> |
The element against which the entity toolbar is positioned. |
remove()
{@inheritdoc}
removeClass(toolgroup, classes)
Removes classes from a toolgroup.
Parameters:
Name | Type | Description |
---|---|---|
toolgroup |
string | A toolgroup name. |
classes |
string | A string of space-delimited class names that will be removed from the wrapping element of the toolbar group. |
render() → {Drupal.quickedit.EntityToolbarView}
{@inheritdoc}
Returns:
The entity toolbar view.
show(toolgroup)
Shows a toolgroup.
Parameters:
Name | Type | Description |
---|---|---|
toolgroup |
string | A toolgroup name. |
windowChangeHandler(event)
Repositions the entity toolbar on window scroll and resize.
Parameters:
Name | Type | Description |
---|---|---|
event |
jQuery.Event | The scroll or resize event. |