Options
All
  • Public
  • Public/Protected
  • All
Menu

A decorator is responsible for adding decorations to a tree of DOM elements. Decorations are GUI elements.

Hierarchy

Implements

  • DecoratorAPI

Index

Constructors

constructor

Properties

Protected domlistener

domlistener: DOMListener

Protected editor

editor: EditorAPI

The editor instance for which this decorator was created.

Protected guiUpdater

guiUpdater: GUIUpdater

Protected mode

mode: Mode

Protected namespaces

namespaces: Record<string, string>

Methods

Abstract addHandlers

  • addHandlers(): void
  • Request that the decorator add its event handlers to its listener.

    Returns void

Protected contextMenuHandler

  • contextMenuHandler(atStart: boolean, wedEv: JQueryMouseEventObject, ev: JQueryEventObject): boolean
  • Context menu handler for the labels of elements decorated by Decorator.elementDecorator.

    Parameters

    • atStart: boolean

      Whether or not this event is for the start label.

    • wedEv: JQueryMouseEventObject

      The DOM event that wed generated to trigger this handler.

    • ev: JQueryEventObject

      The DOM event that wed received.

    Returns boolean

    To be interpreted the same way as for all DOM event handlers.

elementDecorator

  • elementDecorator(_root: Element, el: Element, level: number, preContextHandler: function | undefined, postContextHandler: function | undefined): void
  • Parameters

    • _root: Element
    • el: Element
    • level: number
    • preContextHandler: function | undefined
    • postContextHandler: function | undefined

    Returns void

listDecorator

  • listDecorator(el: Element, sep: string | Element): void

Protected mustHideAttribute

  • mustHideAttribute(el: Element, name: string): boolean
  • Determine whether an attribute must be hidden. The default implementation calls upon the attributes.autohide section of the "wed options" that were used by the mode in effect to determine whether an attribute should be hidden or not.

    Parameters

    • el: Element

      The element in the GUI tree that we want to test.

    • name: string

      The attribute name in "prefix:localName" format where "prefix" is to be understood according to the absolute mapping defined by the mode.

    Returns boolean

    true if the attribute must be hidden. false otherwise.

setReadOnly

  • setReadOnly(el: Element, readonly: boolean): void
  • Add or remove the CSS class _readonly on the basis of the 2nd argument.

    Parameters

    • el: Element

      The element to modify. Must be in the GUI tree.

    • readonly: boolean

      Whether the element is readonly or not.

    Returns void

startListening

  • startListening(): void

Generated using TypeDoc