mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 07:08:12 +00:00
[Composition] Use composition.add from LinkService
This commit is contained in:
@ -63,8 +63,7 @@ define(
|
||||
*/
|
||||
CompositionCapability.prototype.add = function (domainObject, index) {
|
||||
var id = typeof domainObject === 'string' ?
|
||||
domainObject : domainObject.getId(),
|
||||
$q = this.$q;
|
||||
domainObject : domainObject.getId();
|
||||
|
||||
function addIdToModel(model) {
|
||||
var composition = model.composition,
|
||||
@ -73,7 +72,7 @@ define(
|
||||
// If no index has been specified already and the id is already
|
||||
// present, nothing to do. If the id is already at that index,
|
||||
// also nothing to do, so cancel mutation.
|
||||
if ((isNaN(index) && oldIndex !== -1) || (index === oldIndex) {
|
||||
if ((isNaN(index) && oldIndex !== -1) || (index === oldIndex)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user