[Actions] Define applicability
Define applicability of Move/Copy/Link using appliesTo, to avoid errors being thrown due to lack of context during instantiation. Addresses immediate cause of nasa/openmctweb#120.
This commit is contained in:
@@ -122,6 +122,14 @@ define(
|
||||
});
|
||||
};
|
||||
|
||||
AbstractComposeAction.appliesTo = function (context) {
|
||||
var applicableObject =
|
||||
context.selectedObject || context.domainObject;
|
||||
|
||||
return !!(applicableObject &&
|
||||
applicableObject.hasCapability('context'));
|
||||
};
|
||||
|
||||
return AbstractComposeAction;
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user