Class: EntityToolbarView

Drupal.quickedit. EntityToolbarView

new Drupal.quickedit.EntityToolbarView(options)

Name Type Description
options object

Options to construct the view.

Name Type Description
appModel Drupal.quickedit.AppModel

A quickedit AppModel to use in the view.

Extends

  • Backbone.View

Members

_fieldToolbarRootjQuery

Methods

Finds a toolgroup.

Name Type Description
toolgroup string

A toolgroup name.

Returns:
Type Description
jQuery The toolgroup DOM element.

Adds classes to a toolgroup.

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.

Builds the entity toolbar HTML; attaches to DOM; sets starting position.

Returns:
Type Description
jQuery The toolbar element.
Returns:
Type Description
object A map of events.

Determines the actions to take given a change of state.

Name Type Description
model Drupal.quickedit.FieldModel

The FieldModel model.

state string

The state of the associated field. One of Drupal.quickedit.FieldModel.states.

Returns the DOM element that fields will attach their toolbars to.

Returns:
Type Description
jQuery The DOM element that fields will attach their toolbars to.

Generates a state-dependent label for the entity toolbar.

Sets the model state to candidate when the cancel button is clicked.

Name Type Description
event jQuery.Event

The click event.

Set the model state to 'saving' when the save button is clicked.

Name Type Description
event jQuery.Event

The click event.

Clears the timeout that will eventually reposition the entity toolbar.

Without this, it may reposition itself, away from the user's cursor!

Name Type Description
event jQuery.Event

The mouse event.

Uses the jQuery.ui.position() method to position the entity toolbar.

Name Type Description
element HTMLElement optional

The element against which the entity toolbar is positioned.

Removes classes from a toolgroup.

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.

Returns:
Type Description
Drupal.quickedit.EntityToolbarView The entity toolbar view.

Shows a toolgroup.

Name Type Description
toolgroup string

A toolgroup name.

Repositions the entity toolbar on window scroll and resize.

Name Type Description
event jQuery.Event

The scroll or resize event.