UNPKG

@opentiny/fluent-editor

Version:

A rich text editor based on Quill 2.0, which extends rich modules and formats on the basis of Quill. It's powerful and out-of-the-box.

30 lines (29 loc) 645 B
import BlotSpec from "./BlotSpec.es.js"; class ImageSpec extends BlotSpec { constructor(formatter) { super(formatter); this.onClick = (event) => { const el = event.target; if (!(el instanceof HTMLElement) || el.tagName !== "IMG") { return; } event.stopPropagation(); this.img = el; this.formatter.show(this); }; this.img = null; } init() { this.formatter.quill.root.addEventListener("click", this.onClick); } getTargetElement() { return this.img; } onHide() { this.img = null; } } export { ImageSpec as default }; //# sourceMappingURL=ImageSpec.es.js.map