new module:ct-popout /Popout(relative Url, window Parameters)
Creates a popout window. The opened window may contain any content, with the caveat that it references
module:ct-popout/PopoutService
. Typically this content will be a representation of a component "popped
out" of the main application's window.
A Popout
may have properties set on it, and events fired on it, both of which will be reflected on the
module:ct-popout/PopoutService
in the popout window, allowing communication between the opening window
and the popout window.
This class uses emitr, and fires the following events:
- Popout.EVENTS.POPOUT_READY
- Fired after #_onPopoutWindowReady has completed.
- Popout.EVENTS.POPOUT_BLOCKED
- Fired if the browser blocks the popout window from opening.
- Popout.EVENTS.POPOUT_TIMEOUT
- Fired if the popped out window takes longer than a given time to open. This is 10000ms by default, and can be set using the 'CAPLIN.POPOUT.TIMEOUT.LOAD' property on caplin.config-service.
- Popout.EVENTS.POPOUT_CLOSED
- Fired when the popped out window is closed.
- Popout.EVENTS.PROPERTIES_CHANGED
- Fired when the properties of this Popout are changed. Event args: {map} properties A map of the new values of the changed properties.
- Popout.EVENTS.POPOUT_RESIZED
- Fired when the popped out window is resized. Event args: {int} width The new width of the popped out window, {int} height The new height of the popped out window.
Parameters:
Name | Type | Description |
---|---|---|
relativeUrl |
string | The relative URL that the popped out window will use. |
windowParameters |
object | Parameters to be passed to the window.open call. |
Methods
close()
Closes the popout window.
fire Event(name, properties)
Fires the given event both on this object and on the ct-popout/PopoutService
in the popout window.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the event. |
properties |
Object | A map of properties to be passed along with the event. |
get Properties() → {map}
Gets the properties for this Popout
.
Returns:
properties The map of properties for this popout.
- Type
- map
get Property(property Name) → {var}
Gets the value for a given property.
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
String | The name of the property to get. |
Returns:
The value of the property.
- Type
- var
get Window() → {object}
Gets the popout window.
Returns:
the window object for the popped out window.
- Type
- object
get Window Geometrics() → {map}
Returns the current position and dimensions of the popout window.
Returns:
Contains geometric properties with integer values. Included properties are: 'width', 'height', 'left' and 'top'.
- Type
- map
open(width, height)
Opens the popout window with the given width and height.
Parameters:
Name | Type | Description |
---|---|---|
width |
int | The desired width for the opened window. |
height |
int | The desired height for the opened window. |
set Properties(properties)
Sets properties for this Popout
that can be accessed in the popped out window using the
PopoutService
's getProperty
and getProperties
methods.
Parameters:
Name | Type | Description |
---|---|---|
properties |
Object | The map of properties to set. |