Handle selection changes and actions on the competency tree.
- Source:
- Copyright:
- 2015 Damyon Wiese
- 2015 Damyon Wiese
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Members
(inner) moveSource :Node
The start of a drag operation
Type:
- Node
(inner) moveTarget :Node
The end of a drag operation
Type:
- Node
(inner) pageContextId :Number
The page context ID.
Type:
- Number
(inner) Picker :Object
instance.
Type:
- Object
(inner) Rule :Object
config instance.
Type:
- Object
(inner) Taxonomy :Object
constants indexed per level.
Type:
- Object
(inner) The :Object
competency we're picking a relation to.
Type:
- Object
(inner) The :Array
rules modules. Values are object containing type, namd and amd.
Type:
- Array
(inner) the :Number
selected competency ID.
Type:
- Number
(inner) treeModel :Object
This is an object representing the nodes in the tree.
Type:
- Object
Methods
(inner) addCompetencyChildren(parent, competencies)
Turn a flat list of competencies into a tree structure (recursive).
Parameters:
Name | Type | Description |
---|---|---|
parent |
Object | The current parent node in the tree |
competencies |
Array.<Object> | The flat list of competencies |
(inner) addHandler()
Respond to choosing the "Add" menu item for the selected node in the tree.
(inner) allowDrop(e)
HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
(inner) confirmMove()
Confirms a competency move.
(inner) deleteCompetencyHandler()
Show a confirm dialogue before deleting a competency.
(inner) deleteRelatedHandler(e)
Deletes a related competency without confirmation.
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | The event that triggered the action. |
(inner) doDelete()
Delete a competency.
(inner) doMove()
A source and destination has been chosen - so time to complete a move.
(inner) dragEnter(e)
HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
(inner) dragLeave(e)
HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
(inner) dragStart(e)
HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
(inner) dropOver(e)
HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
(inner) editHandler()
Edit the selected competency.
(inner) getTaxonomyAtLevel(level) → {String}
Return the taxonomy constant for a level.
Parameters:
Name | Type | Description |
---|---|---|
level |
Number | The level. |
Returns:
- Type
- String
(inner) init(model, pagectxid, taxonomies, rulesMods)
Initialise this page (attach event handlers etc).
Parameters:
Name | Type | Description |
---|---|---|
model |
Object | The tree model provides some useful functions for loading and searching competencies. |
pagectxid |
Number | The page context ID. |
taxonomies |
Object | Constants indexed by level. |
rulesMods |
Object | The modules of the rules. |
(inner) initMovePopup(popup)
A move competency popup was opened - initialise the aria tree in it.
Parameters:
Name | Type | Description |
---|---|---|
popup |
dialogue | The tool_lp/dialogue that was created. |
(inner) moveDownHandler()
Move a competency "down". This only affects the sort order within the same branch of the tree.
(inner) moveHandler(e)
A node was chosen and "Move" was selected from the menu. Open a popup to select the target.
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
(inner) moveUpHandler()
Move a competency "up". This only affects the sort order within the same branch of the tree.
(inner) parseTaxonomies(taxonomiesstr) → {Array}
Return the string "Selected
Parameters:
Name | Type | Description |
---|---|---|
taxonomiesstr |
String | Comma separated list of taxonomies. |
Returns:
of level => taxonomystr
- Type
- Array
(inner) relateCompetenciesHandler()
Open a competencies popup to relate competencies.
(inner) reloadPage(context)
Re-render the page with the latest data.
Parameters:
Name | Type | Description |
---|---|---|
context |
Object |
(inner) seeCoursesHandler()
Open a dialogue to show all the courses using the selected competency.
(inner) selectionChanged(evt, params) → {Boolean}
Handler when a node in the aria tree is selected.
Parameters:
Name | Type | Description |
---|---|---|
evt |
Event | The event that triggered the selection change. |
params |
Object | The parameters for the event. Contains a list of selected nodes. |
Returns:
- Type
- Boolean
(inner) strAddTaxonomy(level) → {String}
Return the string "Add
Parameters:
Name | Type | Description |
---|---|---|
level |
Number | The level. |
Returns:
- Type
- String
(inner) strSelectedTaxonomy(level) → {String}
Return the string "Selected
Parameters:
Name | Type | Description |
---|---|---|
level |
Number | The level. |
Returns:
- Type
- String
(inner) triggerCompetencyViewedEvent(competency)
Log the competency viewed event.
Parameters:
Name | Type | Description |
---|---|---|
competency |
Object | The competency. |
(inner) updatedRelatedCompetencies()
Updates the competencies list (with relations) and add listeners.
(inner) updateSearchHandler(e)
Perform a search and render the page with the new search results.
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |