new AppView(options)
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | An object with the following keys: Properties
|
Extends
- Backbone.View
Methods
acceptEditorStateChange(from, to, context, fieldModel) → {bool}
Accepts or reject editor (Editor) state changes.
This is what ensures that the app is in control of what happens.
Parameters:
Name | Type | Description |
---|---|---|
from |
string | The previous state. |
to |
string | The new state. |
context |
null | object | The context that is trying to trigger the state change. |
fieldModel |
Drupal.quickedit.FieldModel | The fieldModel to which this change applies. |
Returns:
Whether the editor change was accepted or rejected.
- Type
- bool
appStateChange(entityModel, state)
Handles setup/teardown and state changes when the active entity changes.
Parameters:
Name | Type | Description |
---|---|---|
entityModel |
Drupal.quickedit.EntityModel | An instance of the EntityModel class. |
state |
string | The state of the associated field. One of
|
confirmEntityDeactivation(entityModel)
Asks the user if they want to stop editing via a modal.
Parameters:
Name | Type | Description |
---|---|---|
entityModel |
Drupal.quickedit.EntityModel | An instance of the EntityModel class. |
- Source:
- See:
editorStateChange(fieldModel, state)
Reacts to field state changes; tracks global state.
Parameters:
Name | Type | Description |
---|---|---|
fieldModel |
Drupal.quickedit.FieldModel | The |
state |
string | The state of the associated field. One of
|
enforceSingleActiveEntity(changedEntityModel)
EntityModel Collection change handler.
Handler is called change:isActive
and enforces a single active entity.
Parameters:
Name | Type | Description |
---|---|---|
changedEntityModel |
Drupal.quickedit.EntityModel | The entityModel instance whose active state has changed. |
propagateUpdatedField(updatedField, html, options)
Propagates changes to an updated field to all instances of that field.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
updatedField |
Drupal.quickedit.FieldModel | The FieldModel whose 'html' attribute changed. |
||||||
html |
string | The updated 'html' attribute. |
||||||
options |
object | An object with the following keys: Properties
|
- Source:
- See:
renderUpdatedField(fieldModel, html, options)
Render an updated field (a field whose 'html' attribute changed).
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
fieldModel |
Drupal.quickedit.FieldModel | The FieldModel whose 'html' attribute changed. |
||||||
html |
string | The updated 'html' attribute. |
||||||
options |
object | An object with the following keys: Properties
|
rerenderedFieldToCandidate(fieldModel)
If the new in-place editable field is for the entity that's currently being edited, then transition it to the 'candidate' state.
This happens when a field was modified, saved and hence rerendered.
Parameters:
Name | Type | Description |
---|---|---|
fieldModel |
Drupal.quickedit.FieldModel | A field that was just added to the collection of fields. |
setupEditor(fieldModel)
Sets up the in-place editor for the given field.
Must happen before the fieldModel's state is changed to 'candidate'.
Parameters:
Name | Type | Description |
---|---|---|
fieldModel |
Drupal.quickedit.FieldModel | The field for which an in-place editor must be set up. |
teardownEditor(fieldModel)
Tears down the in-place editor for the given field.
Must happen after the fieldModel's state is changed to 'inactive'.
Parameters:
Name | Type | Description |
---|---|---|
fieldModel |
Drupal.quickedit.FieldModel | The field for which an in-place editor must be torn down. |