import
Description
Fires after pressing the "Import" option in the menubar or via Event Bus methods
Usage
"import": ({ html?: string }) => boolean | void;
Parameters
The callback of import event can take an object with the following parameter:
html
- a text value in the html format
info
For handling inner events you can use Event Bus methods
Example
// initialize RichText
const editor = new richtext.Richtext("#root", {
// configuration properties
});
// subscribe to the "import" event
editor.api.on("import", (obj) => {
console.log(obj.html);
console.log("The new value was imported");
});
// import new value
editor.api.exec("import", {
html: "<h2>some value</h2>" // simply calls setValue
});
Change log: The event was added in v2.0