show-popup
Description
Fires when a popup is shown/hidden
Usage
"show-popup": (IPopupConfig) => boolean | void;
interface IPopupConfig {
type: "link" | null;
image?: boolean;
}
Parameters
The callback of the show-popup event can take an object with the following parameters:
type
- a type of the popupimage
- provides access to additional context (is the current cursor pointing at an image or not)
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 "show-popup" event
editor.api.on("show-popup", (obj) => {
console.log(obj);
console.log("The popup was shown/hidden");
});
// show-popup the text to the left
editor.api.exec("show-popup", {
type: "link"
});
Change log: The event was added in v2.0