mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 15:18:12 +00:00
[Tree] Display selection state
This commit is contained in:
@ -394,7 +394,8 @@ define([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "mctTree",
|
"key": "mctTree",
|
||||||
"implementation": MCTTree
|
"implementation": MCTTree,
|
||||||
|
"depends": [ '$parse' ]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"constants": [
|
"constants": [
|
||||||
|
@ -76,6 +76,16 @@ define([
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function getIdPath(domainObject) {
|
||||||
|
function getId(domainObject) {
|
||||||
|
return domainObject.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
return domainObject ?
|
||||||
|
domainObject.getCapability('context').getPath().map(getId) :
|
||||||
|
[];
|
||||||
|
}
|
||||||
|
|
||||||
TreeNodeView.prototype.value = function (domainObject) {
|
TreeNodeView.prototype.value = function (domainObject) {
|
||||||
var activeIdPath = getIdPath(this.activeObject),
|
var activeIdPath = getIdPath(this.activeObject),
|
||||||
selectedIdPath = getIdPath(domainObject);
|
selectedIdPath = getIdPath(domainObject);
|
||||||
|
@ -92,7 +92,7 @@ define([
|
|||||||
TreeView.prototype.updateNodeViewSelection = function () {
|
TreeView.prototype.updateNodeViewSelection = function () {
|
||||||
this.nodeViews.forEach(function (nodeView) {
|
this.nodeViews.forEach(function (nodeView) {
|
||||||
nodeView.value(this.selectedObject);
|
nodeView.value(this.selectedObject);
|
||||||
});
|
}.bind(this));
|
||||||
};
|
};
|
||||||
|
|
||||||
TreeView.prototype.value = function (domainObject) {
|
TreeView.prototype.value = function (domainObject) {
|
||||||
|
Reference in New Issue
Block a user