openFrameAPI - subscribe(openFrameAPIEVENT event, function eventCallback)

Subscribes to the an event.

These events are available.
  • openframe_header_icon_clicked -- this event occurs when any icon other than the close icon is clicked on the OpenFrame header. The callback receives the icon object as a parameter.
  • openframe_shown -- this event occurs when the OpenFrame is shown.
  • openframe_hidden -- this event occurs when the OpenFrame is hidden.
  • openframe_before_destroy -- this event occurs before the TopFrame is unloaded.
  • openframe_communication -- this event is application specific and can be customized.
  • openframe_communication_failure -- this event occurs when communication to TopFrame fails.
Table 1. Parameters
Name Type Description
event openFrameAPIEVENT One of the available events.
eventCallback function The method called when the specified event occurs.
Table 2. Returns
Type Description
void

function handleHeaderIconClick(context) {
console.log("Header Icon was clicked", context);
}
openFrameAPI.subscribe(openFrameAPI.EVENTS.HEADER_ICON_CLICKED, handleHeaderIconClick);