title: Undo Redo for Fabric.js
body: <p>I'm trying to add undo/redo functionality to my Fabric.js canvas. My idea is to have a counter which counts canvas modifications (right now it counts the addition of objects).
  I have a state array, which pushes the whole canvas as JSON to my array.</p>
  
  <p>Then I simply want to recall the states with </p>
  
  <pre><code>canvas.loadFromJSON(state[state.length - 1 + ctr],
  </code></pre>
  
  <p>As the user clicks on undo, ctr will reduce by one and load the state out of the array; as the user clicks on redo, ctr will increase by one and load the state out of the array.</p>
  
  <p>When I experience this with simple numbers, everything works fine. With the real fabric canvas, I get some troubles --> it doesnt really work. I think this relies on my event handler</p>
  
  <pre><code>canvas.on({
     'object:added': countmods
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/gcollect/czaJS/" rel="noreferrer">jsfiddle</a> is here: </p>
  
  <p>here is the working numbers only example (results see console): <a href="http://jsfiddle.net/gcollect/U6T94/" rel="noreferrer">jsFiddle</a></p>