mirror of
https://github.com/nasa/openmct.git
synced 2025-06-11 11:51:40 +00:00
[Edit] Get to true root from EditPanesController
Part of refactoring to hide objects outside of Edit mode from the Create menus in Edit mode, WTD-922.
This commit is contained in:
parent
6e783648d6
commit
bb4ea2d4ae
@ -24,15 +24,19 @@ define(
|
|||||||
// This is a "lookup" style capability (it looks up other
|
// This is a "lookup" style capability (it looks up other
|
||||||
// domain objects), and it should be idempotent
|
// domain objects), and it should be idempotent
|
||||||
var capability = new EditableLookupCapability(
|
var capability = new EditableLookupCapability(
|
||||||
contextCapability,
|
contextCapability,
|
||||||
editableObject,
|
editableObject,
|
||||||
domainObject,
|
domainObject,
|
||||||
cache,
|
cache,
|
||||||
true // Idempotent
|
true // Idempotent
|
||||||
);
|
),
|
||||||
|
// Track the real root object for the Elements pane
|
||||||
|
trueRoot = capability.getRoot();
|
||||||
|
|
||||||
// Provide access to the real root, for the Elements pane.
|
// Provide access to the real root, for the Elements pane.
|
||||||
capability.getTrueRoot = capability.getRoot;
|
capability.getTrueRoot = function () {
|
||||||
|
return trueRoot;
|
||||||
|
};
|
||||||
|
|
||||||
// Hide ancestry after the root of this subgraph
|
// Hide ancestry after the root of this subgraph
|
||||||
if (cache.isRoot(domainObject)) {
|
if (cache.isRoot(domainObject)) {
|
||||||
|
@ -16,7 +16,7 @@ define(
|
|||||||
function updateRoot(domainObject) {
|
function updateRoot(domainObject) {
|
||||||
var context = domainObject &&
|
var context = domainObject &&
|
||||||
domainObject.getCapability('context'),
|
domainObject.getCapability('context'),
|
||||||
newRoot = context && context.getRealRoot(),
|
newRoot = context && context.getTrueRoot(),
|
||||||
oldId = root && root.getId(),
|
oldId = root && root.getId(),
|
||||||
newId = newRoot && newRoot.getId();
|
newId = newRoot && newRoot.getId();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user