Now.js Framework Documentation

Now.js Framework Documentation

RichTextElementFactory

EN 04 Sep 2026 01:40

RichTextElementFactory

RichTextElementFactory - Integrates RichTextEditor with ElementManager Usage: Options (via data-* attributes): data-rte-profile="basic|full|minimal|comment" - editor profile (default: basic) data-rte-height="400" - editor height in px data-rte-min-height="200" - min height in px data-rte-placeholder="..." - placeholder text data-rte-sticky="true" - sticky toolbar data-rte-allow-style="true" - allow

Generated from source on 2026-08-21. Descriptions come from JSDoc in the file.
Re-run docs_scaffold when the code changes; hand edits are lost on regeneration

Source

  • File: Now/js/RichTextElementFactory.js (429 lines)
  • Form: ES class

Public methods (3)

static cleanup(instance)

Destroy the editor attached to this element and release the reference. Safe to call when no editor was created, and errors thrown by the editor's own destroy are swallowed so teardown of the surrounding form still finishes.

static extractCustomConfig(element, def, dataset)

Read the editor options a single element declares through its data-rte-* attributes. Anything not declared falls back to the value in def, and placeholder also falls back to the element's own placeholder attribute.

static setupElement(instance)

Attach a RichTextEditor to the element and keep it in sync with the form. The editor bundle is loaded separately, so this retries every 100 ms until window.RichTextEditor exists rather than failing when it is not ready yet.

Data attributes used

data-read-only · data-rte-allow-iframe · data-rte-allow-interactive-tags · data-rte-allow-script · data-rte-allow-style · data-rte-fallback-bound · data-rte-fallback-loaded · data-rte-height · data-rte-max-height · data-rte-media-fallback · data-rte-min-height · data-rte-placeholder · data-rte-profile · data-rte-sticky

Depends on

ElementFactory · ElementManager