mirror of
https://github.com/nasa/openmct.git
synced 2025-06-22 00:57:11 +00:00
[Angular] Check for context capability
Check for existence of context capability from Remove action during navigation check. This avoids an exception that appears to have been swallowed in earlier versions of Angular.
This commit is contained in:
@ -90,7 +90,8 @@ define(
|
|||||||
*/
|
*/
|
||||||
function checkObjectNavigation(object, parentObject) {
|
function checkObjectNavigation(object, parentObject) {
|
||||||
// Traverse object starts at current location
|
// Traverse object starts at current location
|
||||||
var traverseObject = (navigationService).getNavigation();
|
var traverseObject = (navigationService).getNavigation(),
|
||||||
|
context;
|
||||||
|
|
||||||
// Stop when object is not defined (above ROOT)
|
// Stop when object is not defined (above ROOT)
|
||||||
while (traverseObject) {
|
while (traverseObject) {
|
||||||
@ -103,7 +104,8 @@ define(
|
|||||||
}
|
}
|
||||||
// Traverses to parent of current object, moving
|
// Traverses to parent of current object, moving
|
||||||
// up the ascendant path
|
// up the ascendant path
|
||||||
traverseObject = traverseObject.getCapability('context').getParent();
|
context = traverseObject.getCapability('context');
|
||||||
|
traverseObject = context && context.getParent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user