Back to Elementor

Legend

docs/assets/dev/js/editor/document/component.md

4.1.04.7 KB
Original Source

Legend

  • For all the examples in the Document component and its subcomponents, the following legend is used, to determine which type of element is being used:
  • Section ID - 98c3441

  • Column ID   - 18f2ab4, 4b957d9

  • Widget ID   - 5412776

Every element in the document has a unique ID which is used to identify it in the editor, and is resolved to a unique Container object that can be accessed using the following method:

javascript
elementor.getContainer( ID );

Every command under document uses container or containers as parameters to define the target.

The commands can accept container or containers but not both.

PropertyTypeDescription
container{Container}Target.
containers{Container[]}Targets.

Component -- $e.components.get('document')

  • Name: Document.
  • Description: Document is used as namespace of describing changes in the document made by the command.

All Document subcomponents

Component NameAccess ComponentDescription
Dynamic$e.components.get('document/dynamic')Dynamic enable, disable and change.
Elements$e.components.get('document/elements')Elements manipulation (create, edit, remove, etc.).
History$e.components.get('document/history')Provides a way to record/manipulate the commands history.
Repeater$e.components.get('document/repeater')Provides a way to communicate with repeaters.
Save$e.components.get('document/save')Responsible for saving the document (either publish/draft).
UI$e.components.get('document/ui')Irregular component for handling UI shortcuts.

Component document -- Utils

Util NameAccess Util
findViewRecursive$e.components.get('document').utils.findViewRecursive()
findViewById$e.components.get('document').utils.findViewById()
findContainerById$e.components.get('document').utils.findContainerById()

Util -- $e.components.get('document').utils.findViewRecursive()

  • Name: findViewRecursive.

  • Description: Find view recursively, the method will run recursively until it finds the view with given key & value.

  • Returns: {Array}

    PropertyTypeRequirementDescription
    parent{Marionette.View}requiredParent view.
    key{String}requiredKey of the view used to find the view. e.g: id.
    value{String}requiredValue of the view used to find the view. e.g: 98c3441.
    multiple{Boolean}optionaldefault: {false}. allow multiple results.

Util -- $e.components.get('document').utils.findViewById()

  • Description: Find view by id, the method will run recursively until it finds the view with the given id.

  • Returns: { View | View[] }

    PropertyTypeRequirementDescription
    id{String}requiredId of the element.

Util -- $e.components.get('document').utils.findContainerById()

  • Name: findContainerById.

  • Description: Find container by id, the method will run recursively until it finds the {elementorModules.editor.Container} with given id.

  • Returns: { Container | Container[] }

    PropertyTypeRequirementDescription
    id{String}requiredId of the element.

Back