Commit b10878d1 authored by bbaer's avatar bbaer
Browse files

added fabric.editor.buttons to resources

parent 99b30f0c
{
"modes": [
{
"name": "rotateRight",
"selector": "turn-right",
"requiresDrawing": false,
"requiresSelection": false,
"isToggle": false,
"toggle": "",
"hasToggleElement": false,
"toggleElement": "",
"icon": "glyphicon-repeat"
}, {
"name": "exportImage",
"selector": "export-img",
"requiresDrawing": false,
"requiresSelection": false,
"isToggle": false,
"toggle": "",
"hasToggleElement": false,
"toggleElement": "",
"icon": "glyphicon-floppy-disk"
}
],
"currentMode": ""
}
\ No newline at end of file
......@@ -435,7 +435,7 @@ $(function (n) {
var oldWidth = this.canvas.getWidth();
var backgroundImageWidth = 0;
if (this.canvas.backgroundImage) {
backgroundImageWidth = this.canvas.backgroundImage.getWidth() || 0;
backgroundImageWidth = this.canvas.backgroundImage.width || 0;
}
if (oldWidth !== backgroundImageWidth && backgroundImageWidth !== 0) {
oldWidth = backgroundImageWidth;
......@@ -494,9 +494,6 @@ $(function (n) {
that.canvas.setBackgroundImage(img, that.canvas.renderAll.bind(that.canvas));
});
} else {
//var getJSON = $('#fabric').data('images');
//console.log(getJSON.images[0].selector);
//var $image = document.getElementById(getJSON.images[0].selector);
var $image = document.getElementsByClassName("qfq-fabric-image")[0];
var img = new fabric.Image($image, {
width: this.canvas.width,
......@@ -856,7 +853,6 @@ $(function (n) {
}
}
this.canvas.centerObject(img);
console.log("img width after Resize: " + img.width);
this.canvas.renderAll();
};
......@@ -972,22 +968,18 @@ $(function (n) {
};
n.Fabric.prototype.defaultObjectHoverHandler = function() {
console.log("Over object");
this.overObject = true;
};
n.Fabric.prototype.defaultObjectOutHandler = function() {
console.log("Left object");
this.overObject = false;
};
n.Fabric.prototype.defaultSelectionCreateHandler = function() {
console.log("Selection created");
this.selectionActive = true;
};
n.Fabric.prototype.defaultSelectionClearHandler = function() {
console.log("Selection cleared");
this.selectionActive = false;
};
......@@ -1005,13 +997,13 @@ $(function (n) {
};
n.Fabric.prototype.deactivateAllObjects = function() {
this.canvas.forEachObject(function(object){
this.canvas.forEachObject(function(object) {
object.selectable = false;
});
};
n.Fabric.prototype.activateAllObjects = function() {
this.canvas.forEachObject(function(object){
this.canvas.forEachObject(function(object) {
object.selectable = true;
});
};
......
......@@ -10,7 +10,7 @@
<link rel="stylesheet" href="../css/jqx.base.css">
<link rel="stylesheet" href="../css/jqx.bootstrap.css">
<link rel="stylesheet" href="../extension/Resources/Public/Css/qfq-bs.css">
<title>Input Mode Switcher</title>
<title>Fabric Image Editor</title>
</head>
<body>
......
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