mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 13:48:12 +00:00
[Edit] Hide root object
Act as if the object being edited is the root object when in Edit mode, except in the Library pane (which has its own means of getting the real root object.) WTD-922.
This commit is contained in:
@ -23,13 +23,28 @@ define(
|
||||
) {
|
||||
// This is a "lookup" style capability (it looks up other
|
||||
// domain objects), and it should be idempotent
|
||||
return new EditableLookupCapability(
|
||||
var capability = new EditableLookupCapability(
|
||||
contextCapability,
|
||||
editableObject,
|
||||
domainObject,
|
||||
cache,
|
||||
true // Idempotent
|
||||
);
|
||||
|
||||
// Provide access to the real root, for the Elements pane.
|
||||
capability.getTrueRoot = capability.getRoot;
|
||||
|
||||
// Hide ancestry after the root of this subgraph
|
||||
if (cache.isRoot(domainObject)) {
|
||||
capability.getRoot = function () {
|
||||
return editableObject;
|
||||
};
|
||||
capability.getPath = function () {
|
||||
return [editableObject];
|
||||
};
|
||||
}
|
||||
|
||||
return capability;
|
||||
};
|
||||
}
|
||||
);
|
Reference in New Issue
Block a user