Is there a way to make an instance string / method variable? For example
function drag(type){
//replace type in string below
fabric.type.prototype.controls.moveObject = new fabric.Control({
x: -0.5,
y: -0.5,
actionHandler: fabric.controlsUtils.dragHandler,
actionName: 'drag',
cursorStyle:'pointer',
render:renderIcon(dragIcon),
cornerSize: 25
});
}
Hope somebody has the answer for me :)