new EditorView(options)
A base implementation that outlines the structure for in-place editors.
Specific in-place editor implementations should subclass (extend) this View and override whichever method they deem necessary to override.
Typically you would want to override this method to set the originalValue attribute in the FieldModel to such a value that your in-place editor can revert to the original value when necessary.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | An object with the following keys: Properties
|
- Source:
- See:
Example
Drupal.quickedit.EditorView.prototype.initialize.call(this, options);
Extends
- Backbone.View
Methods
getEditedElement() → {jQuery}
Returns the edited element.
For some single cardinality fields, it may be necessary or useful to not in-place edit (and hence decorate) the DOM element with the data-quickedit-field-id attribute (which is the field's wrapper), but a specific element within the field's wrapper. e.g. using a WYSIWYG editor on a body field should happen on the DOM element containing the text itself, not on the field wrapper.
- Source:
- See:
Returns:
A jQuery-wrapped DOM element.
- Type
- jQuery
getQuickEditUISettings() → {object}
Returns:
Returns 3 Quick Edit UI settings that depend on the in-place editor:
- Boolean padding: indicates whether padding should be applied to the edited element, to guarantee legibility of text.
- Boolean unifiedToolbar: provides the in-place editor with the ability to insert its own toolbar UI into Quick Edit's tightly integrated toolbar.
- Boolean fullWidthToolbar: indicates whether Quick Edit's tightly integrated toolbar should consume the full width of the element, rather than being just long enough to accommodate a label.
- Type
- object
remove()
{@inheritdoc}
removeValidationErrors()
Cleans up validation error messages.
Should be called when the state is changed to 'candidate' or 'saving'. In the case of the latter: the user has modified the value in the in-place editor again to attempt to save again. In the case of the latter: the invalid value was discarded.
revert()
Reverts the modified value to the original, before editing started.
save()
Saves the modified value in the in-place editor for this field.
showValidationErrors()
Shows validation error messages.
Should be called when the state is changed to 'invalid'.
stateChange(fieldModel, state)
Determines the actions to take given a change of state.
Parameters:
Name | Type | Description |
---|---|---|
fieldModel |
Drupal.quickedit.FieldModel | The quickedit |
state |
string | The state of the associated field. One of
|