[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:
Victor Woeltjen
2015-11-09 16:28:04 -08:00
parent 066fd55590
commit 2866574dc0
5 changed files with 50 additions and 14 deletions

View File

@@ -122,6 +122,14 @@ define(
});
};
AbstractComposeAction.appliesTo = function (context) {
var applicableObject =
context.selectedObject || context.domainObject;
return !!(applicableObject &&
applicableObject.hasCapability('context'));
};
return AbstractComposeAction;
}
);