ClientPageManager 

Page manager for controller on the client side.

Kind: global class


new ClientPageManager(pageFactory, pageRenderer, stateManager, handlerRegistry, window, eventBus) 

Initializes the client-side page manager.

Param Type Description
pageFactory PageFactory Factory used by the page manager to create instances of the controller for the current route, and decorate the controllers and page state managers.
pageRenderer PageRenderer The current renderer of the page.
stateManager PageStateManager The current page state manager.
handlerRegistry HandlerRegistry Instance of HandlerRegistry that holds a list of pre-manage and post-manage handlers.
window Window The utility for manipulating the global context and global client-side-specific APIs.
eventBus EventBus The event bus for dispatching and listening for custom IMA events propagated through the DOM.

clientPageManager._window : ima.window.Window 

The utility for manipulating the global context and global client-side-specific APIs.

Kind: instance property of ClientPageManager


clientPageManager._eventBus : ima.event.EventBus 

The event bus for dispatching and listening for custom IMA events propagated through the DOM.

Kind: instance property of ClientPageManager


clientPageManager._boundOnCustomEventHandler() : function 

Event listener for the custom DOM events used by the event bus, bound to this instance.

Kind: instance method of ClientPageManager


clientPageManager.init() 

Kind: instance method of ClientPageManager


clientPageManager.manage() 

Kind: instance method of ClientPageManager


clientPageManager.destroy() 

Kind: instance method of ClientPageManager


clientPageManager._onCustomEventHandler(event) 

Custom DOM event handler.

The handler invokes the event listener in the active controller, if such listener is present. The name of the controller’s listener method is created by turning the first symbol of the event’s name to upper case, and then prefixing the result with the ‘on’ prefix.

For example: for an event named ‘toggle’ the controller’s listener would be named ‘onToggle’.

The controller’s listener will be invoked with the event’s data as an argument.

Kind: instance method of ClientPageManager

Param Type Description
event CustomEvent The encountered event bus DOM event.

clientPageManager._parseCustomEvent(event) ⇒ Object 

Extracts the details of the provided event bus custom DOM event, along with the expected name of the current controller’s method for intercepting the event.

Kind: instance method of ClientPageManager
Returns: Object - The event’s details.

Param Type Description
event CustomEvent The encountered event bus custom DOM event.

clientPageManager._handleEventWithController(method, data) ⇒ boolean 

Attempts to handle the currently processed event bus custom DOM event using the current controller. The method returns true if the event is handled by the controller.

Kind: instance method of ClientPageManager
Returns: boolean - true if the event has been handled by the controller, false if the controller does not have a method for processing the event.

Param Type Description
method string The name of the method the current controller should use to process the currently processed event bus custom DOM event.
data Object.<string, \*> The custom event’s data.

clientPageManager._handleEventWithExtensions(method, data) ⇒ boolean 

Attempts to handle the currently processed event bus custom DOM event using the registered extensions of the current controller. The method returns true if the event is handled by the controller.

Kind: instance method of ClientPageManager
Returns: boolean - true if the event has been handled by one of the controller’s extensions, false if none of the controller’s extensions has a method for processing the event.

Param Type Description
method string The name of the method the current controller should use to process the currently processed event bus custom DOM event.
data Object.<string, \*> The custom event’s data.