Skip to main content

toggle-layout-mode

Description

Fires when toggling the layout mode

Usage

"toggle-layout-mode": ({ mode?: "classic" | "document" }) => boolean | void;

Parameters

The callback of the toggle-layout-mode event can take an object with the following parameters:

  • mode - the layout mode. The following modes are available: "classic" | "document"
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 "toggle-layout-mode" event
editor.api.on("toggle-layout-mode", (obj) => {
console.log(obj);
console.log("The layout mode was changed");
});
// set the "document" layout mode
editor.api.exec("toggle-layout-mode", { mode: "document" });

Change log: The event was added in v2.0