I'm adding objects to a canvas and keeping track of their type and count number. When I add them to the canvas everything works great but when I'm modifying them I'm struggling with which object was modified in my fabric.js canvas but only if it's a cardtype. I want to get it's coordinates the cardtype and the cardcount. I made a fiddle that shows everything working except that I get the info for all objects even when I only modify one object. How do I only get the actual activeObject and it's info?
Here's the js in the fiddle that I've been trying to work out.
//**********When card is moved************
canvas.on('object:modified', onObjectModified);
function onObjectModified(e) {
var activeObject = e.target;
alert(activeObject.get('left')+' '+ activeObject.get('top')+' '+cardtype+' '+cardcount);
};