onComponentEvents([callback], [remove])

Class: InternalWindowContainer. Method inherited from UIComponent.

Description:

Gets, registers or unregisters an event handler function for events: resize, move, show, hide.

Parameters:

Name Type Default Description

[callback]

function

The event handler function that receives a ComponentEvent object. Pass null to unregister all handler functions.

[remove]

boolean

false

Set to true to unregister the event handler.

Returns:

An array of handler functions if no arguments are passed, otherwise this component for method chaining.

Type: this | Array.<function()>

Examples:

// Example event object:
const e = {
 target: object,       // The component that triggered the event.
 type: string,         // `resize`, `move`, `show`, `hide`.
 interactive: boolean, // Indicates if the event was triggered by user's interaction (not programmatically). Present when e.type is `move` or `resize`.
 x: number,            // New x position of component.
 y: number,            // New y position of component.
 width: number,        // New width of component. Present when e.type is `resize`.
 height: number,       // New height of component. Present when e.type is `resize`.
 innerWidth: number,   // New width of content area of the component. Present when e.type is `resize` and component is Window or InternalWindow.
 innerHeight: number,  // New height of content area of the component. Present when e.type is `resize` and component is Window or InternalWindow.
};

Also See: