Files
talk/plugins/talk-plugin-rich-text/client/components/rte/lib/api.js
T
2018-03-25 01:32:21 +01:00

18 lines
435 B
JavaScript

/**
* An instance of API is passed to all the buttons to
* interact with RTE, which servers as a clean abstraction.
*/
export default class API {
constructor(container, onChange, canUndo, canRedo, undo, redo) {
this.container = container;
this.broadcastChange = onChange;
this.canUndo = canUndo;
this.canRedo = canRedo;
this.undo = undo;
this.redo = redo;
}
focus() {
this.container.focus();
}
}