Problems with Load Itext
Itext with link, to, when i click in the object, execute the link
by Arvind Pal
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<canvas id="lienzo"></canvas>
CSS
#lienzo {
border: 1px solid;
}
JavaScript
var canvas = this.__canvas = new fabric.Canvas('lienzo');
$(document).ready(function() {
var text = new fabric.IText("Click to change Text", {
originX: "left",
originY: "top",
lockMovementX: false,
lockMovementY: false,
lockScalingX: false,
lockScalingY: false,
lockRotation: false,
lockUniScaling: false,
lockScalingFlip: false,
borderColor: "rgba(102,153,255,0.75)",
cornerColor: "rgba(102,153,255,0.5)",
transparentCorners: true,
padding: 0,
hasBorders: true,
hasControls: true,
cornerSize: 12,
id: 5,
nombre: "Objeto_5",
lnk: "Pantalla_1",
left: 10,
top: 50,
width: 300,
height: 52,
fill: "rgb(0,0,0)",
stroke: null,
strokeWidth: 1,
strokeDashArray: null,
strokeLineCap: "butt",
strokeLineJoin: "miter",
strokeMiterLimit: 10,
scaleX: 1,
scaleY: 1,
angle: 0,
flipX: false,
flipY: false,
opacity: 1,
shadow: null,
visible: true,
clipTo: null,
backgroundColor: "",
fillRule: "nonzero",
globalCompositeOperation: "source-over",
transformMatrix: null,
fontSize: 40,
fontWeight: "normal",
fontFamily: "Times New Roman",
fontStyle: "",
lineHeight: 1.16,
textDecoration: "",
textAlign: "left",
textBackgroundColor: ""
});
canvas.add(text).renderAll().setActiveObject(text);
let t =canvas.toDatalessJSON(['id', 'lnk', 'lockUniScaling', 'borderColor', 'cornerColor', 'cornerSize'])
console.log(t)
var JSon = `{
"version": "3.6.3",
"objects": [
{
"type": "text",
"originX": "left",
"originY": "top",
"left": 44,
"top": 53,
"width": 238.9,
"height": 40.68,
"fill": "rgb(0,0,0)",
"stroke": null,
"lockUniScaling": false,
...