Skip to main content

resize-image

Description

Fires when resizing image

Usage

"resize-image": ({ id: number, width: number, height: number }) => boolean | void;

Parameters

The callback of the resize-image event can take an object with the following parameters:

  • id - the image ID
  • width - the image width
  • height - the image height
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 "resize-image" event
editor.api.on("resize-image", (obj) => {
console.log(obj);
console.log("The image was resized")
});

Change log: The event was added in v2.0