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.

34 lines (33 loc) 1.18 kB
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 { Action } from "./action.es.js"; import { ImageToolbarButtons } from "./image-toolbar-buttons.es.js"; import { ImageToolbar } from "./toolbar.es.js"; class ImageToolbarAction extends Action { constructor(formatter) { super(formatter); __publicField(this, "toolbar"); __publicField(this, "buttons"); this.buttons = new ImageToolbarButtons({ buttons: formatter.options.toolbar.buttons }); this.toolbar = new ImageToolbar(); } onCreate() { const toolbar = this.toolbar.create(this.formatter, this.buttons); this.formatter.overlay.appendChild(toolbar); } onDestroy() { const toolbar = this.toolbar.getElement(); if (!toolbar) { return; } this.formatter.overlay.removeChild(toolbar); this.toolbar.destroy(); } } export { ImageToolbarAction }; //# sourceMappingURL=toolbar-action.es.js.map