onWindowEvents([callback], [remove])

Class: Window.

Description:

Gets, registers or unregisters an event handler for window events, such as activate, deactivate, closed, etc.

Parameters:

Name Type Default Description

[callback]

function

The event handler function receiving WindowEvent event object.

[remove]

boolean

false

Set to true to unregister the event handler.

Returns:

Type: this

Examples:

// Example event object:
const e = {
  target: Window,            // The component that triggered the event.
  type: string,              // `activate`, `deactivate`, `minimize`, `restore`, `closing`, `close`, `show`
  interactive: boolean       // Indicates if triggered by user's interaction with window
};