From 4bda4080d2031be54d29afdc3663ed8e74a40d2a Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Wed, 7 Nov 2018 10:07:57 -0800 Subject: [PATCH] Consistent composition order (#2209) * ensure composition loads in specified order * Remove Modern JS to match current style guide --- src/api/composition/CompositionCollection.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/api/composition/CompositionCollection.js b/src/api/composition/CompositionCollection.js index 5c5fbd64b7..5d76dec87a 100644 --- a/src/api/composition/CompositionCollection.js +++ b/src/api/composition/CompositionCollection.js @@ -177,7 +177,15 @@ define([ CompositionCollection.prototype.load = function () { return this.provider.load(this.domainObject) .then(function (children) { - return Promise.all(children.map(this.onProviderAdd, this)); + return Promise.all(children.map(function (c) { + return this.publicAPI.objects.get(c); + }, this)); + }.bind(this)) + .then(function (childObjects) { + childObjects.forEach(function (c) { + this.add(c, true); + }, this); + return childObjects; }.bind(this)) .then(function (children) { this.emit('load');