@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) • 778 B
JavaScript
;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const BlotSpec = require("./BlotSpec.cjs.js");
class ImageSpec extends BlotSpec.default {
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;
}
}
exports.default = ImageSpec;
//# sourceMappingURL=ImageSpec.cjs.js.map