Merge branch 'open-master' into open1482c

Merge in latest in preparation to merge; WTD-1482

Conflicts:
	platform/commonUI/browse/src/creation/CreationService.js
	platform/core/src/models/RootModelProvider.js
	platform/entanglement/src/services/LinkService.js
	platform/entanglement/src/services/MoveService.js
This commit is contained in:
Victor Woeltjen
2015-08-19 15:00:52 -07:00
39 changed files with 1494 additions and 673 deletions

View File

@@ -56,12 +56,25 @@ define(
};
LinkService.prototype.perform = function (object, parentObject) {
function findChild(children) {
var i;
for (i = 0; i < children.length; i += 1) {
if (children[i].getId() === object.getId()) {
return children[i];
}
}
}
return parentObject.useCapability('mutation', function (model) {
if (model.composition.indexOf(object.getId()) === -1) {
model.composition.push(object.getId());
}
}).then(function () {
return parentObject.getCapability('persistence').persist();
}).then(function getObjectWithNewContext() {
return parentObject
.useCapability('composition')
.then(findChild);
});
};