Window
Extends:
Class for a OS.js Window
Static Method Summary
Static Public Methods | ||
public static |
getWindows(): Window[] Get a list of all windows |
|
public static |
lastWindow(): Window Gets the lastly focused Window |
Constructor Summary
Public Constructor | ||
public |
constructor(core: Core, options: Object) Create window |
Member Summary
Public Members | ||
public |
$content: Node The content container |
|
public |
$element: Node The window container |
|
public |
$header: Node The header container |
|
public |
$icon: Node The icon container |
|
public |
$title: Node The title container |
|
public |
The window attributes |
|
public |
Child windows (via 'parent') |
|
public |
Core instance reference |
|
public |
The window destruction state |
|
public |
The Window ID |
|
public |
Parent Window reference |
|
public |
The window rendered state |
|
public |
The window state |
|
public |
The Window ID |
Private Members | ||
private |
Internal timeout reference used for triggering the loading overlay. |
|
private |
Internal variable to signal not to use default position given by user (used for restore) |
|
private |
The window template |
Method Summary
Public Methods | ||
public |
Blur (un-focus) the window |
|
public |
clampToViewport(update: boolean) Clamps the position to viewport |
|
public |
close() Close the window |
|
public |
destroy() Destroy window |
|
public |
Focus the window |
|
public |
getSession(): Object Get a snapshot of the Window session |
|
public |
getState(n: *): * Gets a astate |
|
public |
Gravitates window towards a certain area |
|
public |
init(): * Initialize window |
|
public |
Maximize the window |
|
public |
Minimize (hide) the window |
|
public |
Raise (un-minimize) the window |
|
public |
Render window |
|
public |
resizeFit(container: Element) Resize to fit to current container |
|
public |
Restore (un-maximize) the window |
|
public |
setDimension(dimension: WindowDimension) Set the Window dimension |
|
public |
Set the Window icon |
|
public |
setNextZindex(force: boolean) Sets the Window to next z index |
|
public |
setPosition(position: WindowPosition, preventDefault: Boolean) Set the Window position |
|
public |
Set a state by value |
|
public |
Set the Window title |
|
public |
Set the Window z index |
Private Methods | ||
private |
Internal method for setting state |
|
private |
_toggleState(name: String, value: *, eventName: String, update: Boolean): boolean Internal method for toggling state |
|
private |
Updates the window buttons |
|
private |
Updated the Window DOM |
Static Public Methods
Public Constructors
public constructor(core: Core, options: Object) source
Create window
Params:
Name | Type | Attribute | Description |
core | Core | Core reference |
|
options | Object | Options |
|
options.id | String | Window Id (not globaly unique) |
|
options.title | String |
|
Window Title |
options.icon | String |
|
Window Icon |
options.parent | Window |
|
The parent Window reference |
options.template | String | Function |
|
The Window HTML template (or function with signature (el, win) for programatic construction) |
options.position | WindowPosition | String |
|
Window position |
options.dimension | WindowDimension |
|
Window dimension |
options.attributes | WindowAttributes |
|
Apply Window attributes |
options.state | WindowState |
|
Apply Window state |
Public Members
Private Members
private _loadingDebounce: Boolean source
Internal timeout reference used for triggering the loading overlay.
Public Methods
public clampToViewport(update: boolean) source
Clamps the position to viewport
Params:
Name | Type | Attribute | Description |
update | boolean |
|
Update DOM |
public gravitate(gravity: String) source
Gravitates window towards a certain area
Params:
Name | Type | Attribute | Description |
gravity | String | Gravity |
public render(callback: Function): Window source
Render window
Params:
Name | Type | Attribute | Description |
callback | Function |
|
Callback when window DOM has been constructed |
public resizeFit(container: Element) source
Resize to fit to current container
Params:
Name | Type | Attribute | Description |
container | Element |
|
The DOM element to use |
public setDimension(dimension: WindowDimension) source
Set the Window dimension
Params:
Name | Type | Attribute | Description |
dimension | WindowDimension | The dimension |
public setIcon(uri: String) source
Set the Window icon
Params:
Name | Type | Attribute | Description |
uri | String | Icon URI |
public setNextZindex(force: boolean) source
Sets the Window to next z index
Params:
Name | Type | Attribute | Description |
force | boolean |
|
Force next index |
public setPosition(position: WindowPosition, preventDefault: Boolean) source
Set the Window position
Params:
Name | Type | Attribute | Description |
position | WindowPosition | The position |
|
preventDefault | Boolean |
|
Prevents any future position setting in init procedure |
public setTitle(title: String) source
Set the Window title
Params:
Name | Type | Attribute | Description |
title | String | Title |
public setZindex(zIndex: Number) source
Set the Window z index
Params:
Name | Type | Attribute | Description |
zIndex | Number | the index |