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.

33 lines (32 loc) 980 B
var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); import { BlotSpec } from "./blot-spec.es.js"; class ImageSpec extends BlotSpec { constructor() { super(...arguments); __publicField(this, "img", null); __publicField(this, "onClick", (event) => { const el = event.target; if (!(el instanceof HTMLElement) || el.tagName !== "IMG") { return; } event.stopPropagation(); this.img = el; this.formatter.show(this); }); } init() { this.formatter.quill.root.addEventListener("click", this.onClick); } getTargetElement() { return this.img; } onHide() { this.img = null; } } export { ImageSpec }; //# sourceMappingURL=image-spec.es.js.map