Class: editor

Drupal.quickedit.editors. editor

new Drupal.quickedit.editors.editor(options)

Name Type Description
options object

Options for the editor view.




Stores the textual DOM element that is being in-place edited.

Stores a reference to the text editor object for this field.


The text format for this field.


Indicates whether this text format has transformations.


Loads untransformed text for this field.

More accurately: it re-filters formatted text to exclude transformation filters used by the text format.

Name Type Description
callback function

A callback function that will receive the untransformed text.

  • \Drupal\editor\Ajax\GetUntransformedTextCommand

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.

Type Description
jQuery A jQuery-wrapped DOM element.

inherited getQuickEditUISettings(){object}

Type Description
object 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.

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.

Reverts the modified value to the original, before editing started.

Saves the modified value in the in-place editor for this field.

Shows validation error messages.

Should be called when the state is changed to 'invalid'.

Determines the actions to take given a change of state.

Name Type Description
fieldModel Drupal.quickedit.FieldModel

The quickedit FieldModel that holds the state.

state string

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