Module: crosscuts

Module for handling of crosscuts using the core.
To include in your module (e.g. Plugin) require via 'common/core/users/crosscut' and invoke initialize by passing a reference to a core instance.

Source:

Example

crosscuts.initialize(core);
crosscuts.getIds();

Methods

(static) addMember(node, crosscutId, memberNode, positionopt)

Adds a member to the crosscut at an optionally provided position.

Parameters:
Name Type Attributes Default Description
node module:Core~Node

Owner of the crosscut.

crosscutId string

Crosscut id to add member to.

memberNode module:Core~Node

Node that should be added to crosscut.

position object <optional>
{x:100, y:100}

Position of the member inside crosscut.

Source:

(static) createCrosscut(node, title, orderopt) → {string}

Adds a new crosscut to the node.

Parameters:
Name Type Attributes Description
node module:Core~Node

Owner of the new crosscut.

title string

Visible title of crosscut.

order number <optional>

Tab order starting from 0, if not given will be placed at end.

Source:
Returns:

The id of the newly created crosscut.

Type
string

(static) delMember(node, crosscutId, memberNodeOrPath)

Removes the member from the specified crosscut.

Parameters:
Name Type Description
node module:Core~Node

Owner of the crosscut.

crosscutId string

Id of crosscut.

memberNodeOrPath module:Core~Node | string

Node, or path of, member to delete from crosscut.

Source:

(static) deleteCrosscut(node, crosscutId)

Deletes the crosscut from the node.

Parameters:
Name Type Description
node module:Core~Node

Owner of the crosscut.

crosscutId string

Id of crosscut to delete.

Source:

(static) getIdFromTitle(node, title) → {string}

If title exists and is unique will return the id of the crosscut. If not it will throw an exception.

Parameters:
Name Type Description
node module:Core~Node

Owner of the crosscut.

title string
Source:
Returns:

The crosscut id.

Type
string

(static) getIds(node) → {Array.<string>}

Returns all the cross-cut ideas at the provided node.

Parameters:
Name Type Description
node module:Core~Node

Owner of the crosscuts.

Source:
Returns:

The crosscut ids.

Type
Array.<string>

(static) getInfo(node) → {Array.<object>}

Returns the raw stored crosscut info at the provided node.

Parameters:
Name Type Description
node module:Core~Node
Source:
Returns:
Type
Array.<object>

(static) getMemberPaths(node, crosscutId) → {Array.<string>}

Returns the paths to all members in the specified crosscut.

Parameters:
Name Type Description
node module:Core~Node

Owner of the crosscut.

crosscutId string
Source:
Returns:

Paths of members

Type
Array.<string>

(static) getMemberPosition(node, crosscutId, memberNodeOrPath) → {object}

Return the position at the cross-cuts for the member in the given crosscut at the provided node.

Parameters:
Name Type Description
node module:Core~Node

Owner of the crosscut.

crosscutId string

Crosscut id to add member to.

memberNodeOrPath module:Core~Node | string

Node, or path of, member to get position of.

Source:
Returns:

The position of the member inside the crosscut.

Type
object

(static) getTitles(node) → {Array.<string>}

Returns all titles of the crosscuts at the provided node.

Parameters:
Name Type Description
node module:Core~Node

Owner of the crosscuts.

Source:
Returns:
Type
Array.<string>

(static) initialize(core)

Initializes the module with a core instance. This must be called before any other method.

Parameters:
Name Type Description
core Core

An instance of a Core module.

Source:

(static) setMemberPosition(node, crosscutId, memberNodeOrPath, newPosition)

Updates the position of the member inside the specified crosscut.

Parameters:
Name Type Description
node module:Core~Node

Owner of the crosscut.

crosscutId string

Id of crosscut.

memberNodeOrPath module:Core~Node | string

Node, or path of, member to update position for.

newPosition object

Position of the member inside the crosscut.

Source: