Commit 8b275556 authored by bbaer's avatar bbaer
Browse files

loadJSON with callback

parent d8cb9ea7
......@@ -325,19 +325,18 @@ $(function (n) {
n.Fabric.prototype.prepareStaticCanvas = function(width, height) {
console.log("prepareStaticCanvas");
var that = this;
this.generateStaticCanvas(width, height);
if (this.fabricJSON) {
this.canvas.loadFromJSON(this.fabricJSON);
this.canvas.loadFromJSON(this.fabricJSON, function() {
that.canvas.renderAll();
that.resizeCanvas();
that.canvas.renderAll();
});
} else {
this.setBackground();
this.canvas.renderAll();
}
this.canvas.renderAll();
var that = this;
setTimeout(function () {
that.resizeCanvas();
that.canvas.renderAll();
}, 1000);
};
n.Fabric.prototype.generateStaticCanvas = function(width, height) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment