@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) • 1.09 kB
JavaScript
;
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);
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const blotSpec = require("./blot-spec.cjs.js");
class ImageSpec extends blotSpec.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;
}
}
exports.ImageSpec = ImageSpec;
//# sourceMappingURL=image-spec.cjs.js.map