Add DOM widgets to Nodes
.
An instance of this class is passed into the addRenderNode
extension point callback. Extensions can use it to add DOM widgets that
will be displayed when the node displays.
For example todo
mode uses this class to add checkbox widgets to tasks.
And timer
mode uses this class to add widgets that show when things
will be done.
Methods
- renderInlineWidget(location, length, widget)
- renderLineWidget(widget, options)
Method Details
-
renderInlineWidget(location, length, widget)
-
Add an inline widget to the node. The widget will visually replace the given range of text with the provided widget. The given widget DOM node must be an inline element (as opposed to a block element)
Parameters:
Name Type Description location
Number Text start location.
length
Number Text length.
widget
DOMElement HTML element.
-
renderLineWidget(widget, options)
-
Add a line widget to the node. Line widgets don't affect the node's text display like inline widgets do. Instead the widget is inserted above, below, or overlayed over the node's line according to the passed in options.
Parameters:
Name Type Argument Description widget
Object HTML element to add.
options
RenderLineWidgetOptions <optional>