Commit bf52a566 authored by bbaer's avatar bbaer
Browse files

Revert "pre merge commit"

This reverts commit 3ba5bdbc.
parent 10b7ab33
......@@ -279,23 +279,20 @@ $(function (n) {
this.canvas.loadFromJSON(this.fabricJSON);
}
if (this.backgroundImage) {
this.setBackground()
this.setBackground(this.backgroundImage)
}
this.resizeCanvas();
};
n.Fabric.prototype.generateStaticCanvas = function(width, height) {
var canvas = document.createElement('canvas');
var that = this;
var ratio = height / width;
console.log("image width: " + width);
canvas.width = this.parentElement.innerWidth();
console.log("canvas width: " + canvas.width);
canvas.height = canvas.width * ratio;
this.parentElement.append(canvas);
this.canvas = this.__canvas = new fabric.StaticCanvas(canvas);
this.parentElement.on("click", function(e) { that.toggleObjects(); });
$(window).resize(function() { that.resizeCanvas(); });
};
n.Fabric.prototype.getMeta = function(url, callback) {
......@@ -413,10 +410,10 @@ $(function (n) {
this.canvas.renderAll();
};
n.Fabric.prototype.setBackground = function () {
if (this.backgroundImage) {
n.Fabric.prototype.setBackground = function (imagePath) {
if (imagePath) {
var that = this;
fabric.Image.fromURL(this.backgroundImage, function(img) {
fabric.Image.fromURL(imagePath, function(img) {
img.set({
width: that.canvas.width,
height: that.canvas.height,
......@@ -426,7 +423,6 @@ $(function (n) {
centeredScaling: true
});
that.canvas.setBackgroundImage(img, that.canvas.renderAll.bind(that.canvas));
console.log(that.canvas.width);
});
} else {
//var getJSON = $('#fabric').data('images');
......
......@@ -142,11 +142,7 @@ i.@{spinner_class} {
}
.qfq-color-blue-2 {
background-color: #8dbaed;
}
.qfq-color-blue-2 a {
color: #fff;
background-color: #e2eeff;
}
.qfq-form-right .qfq-label {
......
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