Make loadFromDatalessJSON set design background. Make sure its callback is invoked even if there are no objects in json.

This commit is contained in:
kangax 2010-07-30 09:50:23 -04:00
parent a2bb25043c
commit 3adc592778

View file

@ -1544,6 +1544,8 @@
this.clear();
// TODO: test this
this.backgroundColor = serialized.background;
this._enlivenDatalessObjects(serialized.objects, callback);
},
@ -1561,6 +1563,10 @@
numLoadedObjects = 0,
numTotalObjects = objects.length;
if (numTotalObjects === 0 && callback) {
callback();
}
try {
objects.forEach(function (obj, index) {