Commit 1520e72e authored by bbaer's avatar bbaer
Browse files

seems to work.

parent f34ef88e
......@@ -236,6 +236,7 @@ $(function (n) {
this.modeSettings.initialize(this, jsonButtons);
this.emojiHandler.initialize(this, jsonEmojis);
this.setBackground(jsonImages);
this.setBrush();
};
n.Fabric.prototype.setBackground = function (imageSelector) {
......@@ -252,7 +253,9 @@ $(function (n) {
});
that.canvas.setBackgroundImage(img, that.canvas.renderAll.bind(that.canvas));
});*/
var $image = document.getElementById(imageSelector);
var getJSON = $('#fabric').data('images');
console.log(getJSON.images[0].selector);
var $image = document.getElementById(getJSON.images[0].selector);
var img = new fabric.Image($image, {
width: this.canvas.width,
height: this.canvas.height,
......
......@@ -42,10 +42,10 @@
<div class="row">
<div class="col-md-4">
<div id="fabric" data-images='{"images": [{"page": 1, "selector": "qfq-fabric-image-1"}, {"page":2, "selector": "#qfq..."}]}'>
<div id="fabric" data-images='{"images": [{"page": 1, "selector": "qfq-fabric-image-1"}, {"page":2, "selector": "#qfq..."}]}'></div>
<div id="fabric-controls">
</div>
......
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