I am trying to implement Backbone.js Undo manager with my existing code. My application is kind of template builder.
Here is console.log of main object. http://screencast.com/t/0JDfCY7l
As you can see it has palette and editor object. I want to register undo, redo with that. Here is my code for undo manager intergation.
var UndoManager = new Backbone.UndoManager;
UndoManager.register(app.editor,app.palette,DdBuilder); // Pass any number of arguments
UndoManager.startTracking(); // Start observation after instantiation
$(".fusion_undo").click(function () {
alert(UndoManager.isAvailable("undo")); //returns false always
UndoManager.undo();
});
$(".fusion_redo").click(function () {
UndoManager.redo();
});
I believe it is simple integration and I am missing some minor details. Any idea what it could be?