addAllContainers
void
addAllContainers
(
The
)
Adds all(recurses down) the containers in a group to the given array
- Parameters:
-
The <WireIt.Group>group to get the containers from -
The <Array>array to add all the containers to
applyToContainers
void
applyToContainers
(
group
,
deep
,
func
,
context
)
Applys the given function to all containers in the group.
- Parameters:
-
group <WireIt.Group>The group object to work with -
deep <boolean>Whether to recurse down into sub groups applying to their containers as well -
func <Function>The function to apply (takes 1 arg, the container) -
context <Object>The context to call the function with
getCollapsedConfig
object
getCollapsedConfig
(
group
,
map
)
Get the configuration to pass to a group container
- Parameters:
-
group <WireIt.Group>The group to get the config for -
map <object>Optional The group's map (obtained by WireIt.GroupUtils.getMap(group))
- Returns:
object - The collapsed config
getOuterGroup
WireIt.Group
getOuterGroup
(
The
,
Optional
)
Gets the outer most group (e.g. if this group is inside another one it gives you that one (or its parent group if it has one etc etc))
- Parameters:
-
The <WireIt.Group>group to get the outer group for -
Optional <Function>callback function for each group found (including the given one)
- Returns:
WireIt.Group - The outermost group
getOverridesFromUI
void
getOverridesFromUI
(
)
Set the override options for the group (e.g. rename fields)
Currently sets all overrides not just the ones that are actually changed by the user
removeGroupFromLayer
void
removeGroupFromLayer
(
The
)
Removes the group's containers and sub groups from the layer
- Parameters:
-
The <WireIt.Group>group to remove -
The <WireIt.Layer>layer to remove them from
serialiseGroup
Object
serialiseGroup
(
group
,
containers
)
Removes direct references to group and container objects (replaces with an index), is applied recursively to sub groups
- Parameters:
-
group <WiteIt.Group>The group to serialise -
containers <Array>The array of containers from the group (for generating indexes)
- Returns:
Object - The seriliased group
valueOr
any
valueOr
(
The
)
Gives the argument back or a default if the argument is not a value
- Parameters:
-
The <any>argument to check -
The <any>default value
- Returns:
any - The argument if it is a value or the default
workOutCenter
Array
workOutCenter
(
group
)
Works out the center point of a group
- Parameters:
-
group <WireIt.Group>The group to get the center of
- Returns:
Array - the x, y position of the center