mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-13 08:13:13 +00:00
Make loadFromDatalessJSON set design background. Make sure its callback is invoked even if there are no objects in json.
This commit is contained in:
parent
a2bb25043c
commit
3adc592778
1 changed files with 6 additions and 0 deletions
|
|
@ -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) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue