Module: wcPanel

Source:

Methods


function addButton(name, className, text, tip [, isTogglable] [, toggleClassName])

Creates a new custom button that will appear in the title bar when the panel is active.

Parameters:
Name Type Argument Description
name String The name of the button, to identify it later.
className String A CSS class name to apply to the button.
text String Text to apply to the button.
tip String Tooltip text for the user.
isTogglable Boolean <optional>
If true, will make the button toggle on and off per click.
toggleClassName String <optional>
If this button is toggleable, you can designate an optional CSS class name that will replace the original class name.
Source:

function buttonState(name [, toggleState]) -> Boolean

Gets, or Sets the current toggle state of a custom button that wasadded using wcPanel.addButton.

Parameters:
Name Type Argument Description
name String The name identifier of the button.
toggleState Boolean <optional>
If supplied, will assign a new toggle state to the button.
Source:
Returns:
- The current toggle state of the button.
Type
Boolean

function close()

Forces the window to close.

Source:

function closeable( [enabled]) -> Boolean

Gets, or Sets whether this dock window can be closed by the user.Note: The panel can still be closed programmatically.

Parameters:
Name Type Argument Description
enabled Boolean <optional>
If supplied, toggles whether it can be closed.
Source:
Returns:
the current closeable status.
Type
Boolean

function collapseDirection(direction)

Gets, or Sets the collapse direction for this panel.

Parameters:
Name Type Description
direction module:wcPanel~CollapseDirection | wcDocker.DOCK The collapse direction to use for this panel.
If this value is omitted, the default collapse direction will be used.
Source:

function collapsible( [enabled]) -> Boolean

Gets, or Sets whether this panel can be collapsed to the side or bottom.
This only works if the collapse feature is enabled module:wcDocker~Options.

Parameters:
Name Type Argument Description
enabled Boolean <optional>
If supplied, assigns whether collapsing is enabled.
Source:
Returns:
- The current collapsible enabled state.
Type
Boolean

function detachable( [enabled]) -> Boolean

Sets, or Gets whether this panel can be detached into a floating panel.

Parameters:
Name Type Argument Description
enabled Boolean <optional>
If supplied, assigns whether this panel can be detached.
Source:
Returns:
- Whether this panel can detach.
Type
Boolean

function faicon(icon)

Sets the icon for the panel, shown in the panels tab widget,to an icon defined from the Font-Awesome library.

Parameters:
Name Type Description
icon String The font-awesome icon name.
Source:

function finishLoading( [fadeDuration])

Hides the loading screen.

Parameters:
Name Type Argument Default Description
fadeDuration Number <optional>
0 If supplied, assigns a fade out duration for the loading screen.
Source:

function focus( [flash])

Brings this panel into focus. If it is floating, it will be moved to the front of all other panels.

Parameters:
Name Type Argument Description
flash Boolean <optional>
If true, in addition to bringing the panel into focus, it will also flash for the user.
Source:

function height() -> Number

Retrieves the height of the panel contents.

Source:
Returns:
- Panel height.
Type
Number

function icon(icon)

Sets the icon for the panel, shown in the panels tab widget. Must be a css class name that contains the icon.

Parameters:
Name Type Description
icon String The icon class name.
Source:

function info() -> module:wcDocker~registerOptions

Retrieves the registration info of the panel as declared fromwcDocker.registerPanelType;

Source:
See:
Returns:
- Registered options of the panel type.
Type
module:wcDocker~registerOptions

function initPos( [x] [, y]) -> module:wcDocker~Coordinate

Gets, or Sets the default position of the panel if it is floating. Warning: after the panel has been initialized, this value no longer reflects the current position of the panel.

Parameters:
Name Type Argument Description
x Number | String <optional>
If supplied, sets the horizontal position of the floating panel. Can be a percentage position, or a string with a 'px' or '%' suffix.
y Number | String <optional>
If supplied, sets the vertical position of the floating panel. Can be a percentage position, or a string with a 'px' or '%' suffix.
Source:
Returns:
- The current default position of the panel.
Type
module:wcDocker~Coordinate

function initSize( [x] [, y]) -> module:wcDocker~Size

Gets, or Sets the desired size of the panel. Warning: after the panel has been initialized, this value no longer reflects the current size of the panel.

Parameters:
Name Type Argument Description
x Number | String <optional>
If supplied, sets the desired initial horizontal size of the panel. Can be a pixel position, or a string with a 'px' or '%' suffix.
y Number | String <optional>
If supplied, sets the desired initial vertical size of the panel. Can be a pixel position, or a string with a 'px' or '%' suffix.
Source:
Returns:
- The current initial size of the panel.
Type
module:wcDocker~Size

function isFloating() -> Boolean

Retrieves whether this panel is floating.

Source:
Returns:
Type
Boolean

function isInFocus() -> Boolean

Retrieves whether this panel is in focus.

Source:
Returns:
Type
Boolean

function isVisible() -> Boolean

Retrieves whether this panel can be seen by the user.

Source:
Returns:
- Visibility state.
Type
Boolean

function layout() -> module:wcLayoutSimple | wcLayoutTable

Retrieves the layout instance.

Source:
Returns:
- The layout instance.
Type
module:wcLayoutSimple | wcLayoutTable

function maxSize( [x] [, y]) -> module:wcDocker~Size

Gets, or Sets the maximum size constraint of the panel.

Parameters:
Name Type Argument Description
x Number | String <optional>
If supplied, sets the desired maximum horizontal size of the panel. Can be a pixel position, or a string with a 'px' or '%' suffix.
y Number | String <optional>
If supplied, sets the desired maximum vertical size of the panel. Can be a pixel position, or a string with a 'px' or '%' suffix.
Source:
Returns:
- The current maximum size.
Type
module:wcDocker~Size

function minSize( [x] [, y]) -> module:wcDocker~Size

Gets, or Sets the minimum size constraint of the panel.

Parameters:
Name Type Argument Description
x Number | String <optional>
If supplied, sets the desired minimum horizontal size of the panel. Can be a pixel position, or a string with a 'px' or '%' suffix.
y Number | String <optional>
If supplied, sets the desired minimum vertical size of the panel. Can be a pixel position, or a string with a 'px' or '%' suffix.
Source:
Returns:
- The current minimum size.
Type
module:wcDocker~Size

function moveable( [enabled]) -> Boolean

Sets, or Gets the moveable status of the window.Note: Other panels can not dock beside a non-moving panel as doing so could cause it to move.

Parameters:
Name Type Argument Description
enabled Boolean <optional>
If supplied, assigns whether this panel can be moved.
Source:
Returns:
- Whether the panel is moveable.
Type
Boolean

function off(eventType [, handler])

Unregisters an event associated with this panel.

Parameters:
Name Type Argument Description
eventType module:wcDocker.EVENT The event type, can be a custom event string or a predefined event.
handler module:wcDocker~event:onEvent <optional>
The handler function registered with the event. If omitted, all events registered to the event type are unregistered.
Source:

function on(eventType, handler) -> Boolean

Registers an event associated with this panel.

Parameters:
Name Type Description
eventType String The event type, can be a custom event string or a predefined event.
handler module:wcDocker#onEvent An event handler function to be called when the event is fired.
Source:
Returns:
- Event registration success or failure.
Type
Boolean

function overflowVisible( [visible]) -> Boolean

Gets, or Sets whether overflow on this panel is visible.Use this if a child element within this panel is intended to 'popup' and be visible outside of its parent area.

Parameters:
Name Type Argument Description
visible Boolean <optional>
If supplied, assigns whether overflow is visible.
Source:
Returns:
- The current overflow visibility.
Type
Boolean

function removeButton(name) -> Boolean

Removes a custom button from the panel.

Parameters:
Name Type Description
name String The name identifier for the button to remove.
Source:
Returns:
- Success or failure.
Type
Boolean

function resizeVisible( [visible]) -> Boolean

Gets, or Sets whether the contents of the panel are visible on resize.Use this if the panel has extremely expensive contents which take a long time to resize.

Parameters:
Name Type Argument Description
visible Boolean <optional>
If supplied, assigns whether panel contents are visible during resize.
Source:
Returns:
- The current resize visibility.
Type
Boolean

function scroll( [x] [, y] [, duration]) -> module:wcDocker~Coordinate

Gets, or Sets the scroll position of the panel's contents if it is scrollable; See wcPanel.scrollable).

Parameters:
Name Type Argument Description
x Number <optional>
If supplied, sets the scroll horizontal position of the panel.
y Number <optional>
If supplied, sets the scroll vertical position of the panel.
duration Number <optional>
If supplied, will animate the scroll movement with the supplied duration (in milliseconds).
Source:
Returns:
The current scroll position.
Type
module:wcDocker~Coordinate

function scrollable( [x] [, y]) -> module:wcDocker~Scrollable

Gets, or Sets whether the window is scrollable.

Parameters:
Name Type Argument Description
x Boolean <optional>
If supplied, assigns whether the window is scrollable in the horizontal direction.
y Boolean <optional>
If supplied, assigns whether the window is scrollable in the vertical direction.
Source:
Returns:
- The current scrollable status.
Type
module:wcDocker~Scrollable

function startLoading( [label] [, opacity] [, textOpacity])

Shows the loading screen.

Parameters:
Name Type Argument Default Description
label String <optional>
An optional label to display.
opacity Number <optional>
0.4 If supplied, assigns a custom opacity value to the loading screen.
textOpacity Number <optional>
1 If supplied, assigns a custom opacity value to the loading icon and text displayed.
Source:

function title(title) -> String | Boolean

Gets, or Sets the title for this panel.Titles appear in the tab widget associated with the panel.

Parameters:
Name Type Description
title String | Boolean If supplied, sets the new title (this can be html text). If false, the title bar will be removed.
Source:
Returns:
- The current title.
Type
String | Boolean

function trigger(eventType [, data]) -> Array.<Object>

Triggers an event of a given type to all panels, including itself.

Parameters:
Name Type Argument Description
eventType module:wcDocker.EVENT The event type, can be a custom event string or a predefined event.
data Object <optional>
A custom data object to pass into all handlers.
Source:
Returns:
results - Returns an array with all results returned by event handlers.
Type
Array.<Object>

function width() -> Number

Retrieves the width of the panel contents.

Source:
Returns:
- Panel width.
Type
Number

Type Definitions


typedef var options

An options object for the panel constructor.

Properties:
Name Type Argument Default Description
icon String <optional>
A CSS classname that represents the icon that should display on this panel's tab widget.
faicon String <optional>
An icon name using the Font-Awesome library.
title String | Boolean <optional>
A custom title to display for this panel, if false, title bar will not be shown.
detachToWidth Number | String <optional>
600 Determines the new width when the panel is detached (0 = Don't change). Can be a pixel value, or a string with a 'px' or '%' suffix.
detachToHeight Number | String <optional>
400 Determines the new height when the panel is detached (0 = Don't change). Can be a pixel value, or a string with a 'px' or '%' suffix.
Source: