new image(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
object | Options for the image editor. |
Extends
Methods
ajax(options)
Utility function to make an AJAX request to the server.
In addition to formatting the correct request, this also handles error codes and messages by displaying them visually inline with the image.
Drupal.ajax is not called here as the Form API is unused by this in-place editor, and our JSON requests/responses try to be editor-agnostic. Ideally similar logic and routes could be used by modules like CKEditor for drag+drop file uploads as well.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | Ajax options. Properties
|
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.
- Inherited From:
- Source:
- See:
Returns:
A jQuery-wrapped DOM element.
- Type
- jQuery
getQuickEditUISettings()
{@inheritdoc}
- Overrides:
- Source:
remove()
{@inheritdoc}
- Inherited From:
- Source:
removeValidationErrors()
{@inheritdoc}
- Overrides:
- Source:
renderDropzone(state, text) → {jQuery}
Renders our dropzone element.
Parameters:
Name | Type | Description |
---|---|---|
state |
string | The current state of our editor. Only used for visual styling. |
text |
string | The text to display in the dropzone area. |
Returns:
The rendered dropzone.
- Type
- jQuery
renderToolbar(fieldModel)
Renders our toolbar form for editing metadata.
Parameters:
Name | Type | Description |
---|---|---|
fieldModel |
Drupal.quickedit.FieldModel | The current Field Model. |
revert()
{@inheritdoc}
- Overrides:
- Source:
save()
Saves the modified value in the in-place editor for this field.
- Inherited From:
- Source:
showValidationErrors()
{@inheritdoc}
- Overrides:
- Source:
stateChange(fieldModel, state, options)
{@inheritdoc}
Parameters:
Name | Type | Description |
---|---|---|
fieldModel |
Drupal.quickedit.FieldModel | The field model that holds the state. |
state |
string | The state to change to. |
options |
object | State options, if needed by the state change. |
- Overrides:
- Source:
uploadImage(file)
Validates/uploads a given file.
Parameters:
Name | Type | Description |
---|---|---|
file |
File | The file to upload. |