- Source:
Members
(static) defaultOptions
- Source:
Assign the default options configuration which is used by this Application class. The options and values defined in this object are merged with any provided option values which are passed to the constructor upon initialization. Application subclasses may include additional options which are specific to their usage.
_dragDrop :Array.<DragDrop>
- Source:
DragDrop workflow handlers which are active for this Application
Type:
_element :jQuery
- Source:
An internal reference to the HTML element this application renders
Type:
- jQuery
_scrollPositions :Object|null
- Source:
Track the most recent scroll positions for any vertically scrolling containers
Type:
- Object | null
_searchFilters :Array.<SearchFilter>
- Source:
SearchFilter handlers which are active for this Application
Type:
_tabs :Array.<Tabs>
- Source:
Tab navigation handlers which are active for this Application
Type:
appId :number
- Source:
The application ID is a unique incrementing integer which is used to identify every application window drawn by the VTT
Type:
- number
element :jQuery|HTMLElement
- Source:
Return the active application element, if it currently exists in the DOM
Type:
- jQuery | HTMLElement
id
- Source:
Return the CSS application ID which uniquely references this UI element
options :Object
- Source:
The options provided to this application upon initialization
Type:
- Object
popOut :boolean
- Source:
Control the rendering style of the application. If popOut is true, the application is rendered in its own wrapper window, otherwise only the inner app content is rendered
Type:
- boolean
position :Object
- Source:
Track the current position and dimensions of the Application UI
Type:
- Object
rendered :boolean
- Source:
Return a flag for whether the Application instance is currently rendered
Type:
- boolean
template :string
- Source:
The path to the HTML template file which should be used to render the inner content of the app
Type:
- string
title :string
- Source:
An Application window should define its own title definition logic which may be dynamic depending on its data
Type:
- string
Methods
activateListeners(html)
- Source:
Once the HTML for an Application has been rendered, activate event listeners which provide interactivity for the application
Parameters:
Name | Type | Description |
---|---|---|
html |
jQuery |
bringToTop()
- Source:
Bring the application to the top of the rendering stack
(async) close() → {Promise.<void>}
- Source:
Close the application and un-register references to it within UI mappings This function returns a Promise which resolves once the window closing animation concludes
Returns:
A Promise which resolves once the application is closed
- Type
- Promise.<void>
getData() → {Object|Promise}
- Source:
An application should define the data object used to render its template. This function may either return an Object directly, or a Promise which resolves to an Object If undefined, the default implementation will return an empty object allowing only for rendering of static HTML
Returns:
- Type
- Object | Promise
(async) maximize() → {Promise.<void>}
- Source:
Maximize the pop-out window, expanding it to its original size Take no action for applications which are not of the pop-out variety or are already maximized
Returns:
A Promise which resolves once the maximization action has completed
- Type
- Promise.<void>
(async) minimize() → {Promise.<void>}
- Source:
Minimize the pop-out window, collapsing it to a small tab Take no action for applications which are not of the pop-out variety or apps which are already minimized
Returns:
A Promise which resolves once the minimization action has completed
- Type
- Promise.<void>
render(force, options)
- Source:
Render the Application by evaluating it's HTML template against the object of data provided by the getData method If the Application is rendered as a pop-out window, wrap the contained HTML in an outer frame with window controls
Parameters:
Name | Type | Default | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
force |
boolean |
false
|
Add the rendered application to the DOM if it is not already present. If false, the Application will only be re-rendered if it is already present. |
|||||||||||||||||||||||||||
options |
Object | Additional rendering options which are applied to customize the way that the Application is rendered in the DOM. Properties
|
setPosition(left, top, width, height, scale) → {Object}
- Source:
Set the application position and store it's new location.
Parameters:
Name | Type | Description |
---|---|---|
left |
number | null | The left offset position in pixels |
top |
number | null | The top offset position in pixels |
width |
number | null | The application width in pixels |
height |
number | string | null | The application height in pixels |
scale |
number | null | The application scale as a numeric factor where 1.0 is default |
Returns:
The updated position object for the application containing the new values
- Type
- Object