It seems like that this extension is not working as expected when it is used by by multiple Cytoscape.js instances.
I mean if you create 2 different Cytoscape.js instances as cy1 and cy2 and initialize the extension on these instances as ur1 and ur2 as below:
var ur1 = cy1.undoRedo();
var ur2 = cy2.undoRedo();
then ur1.undo() and ur2.undo() does the same thing (undo the last action performed on cy1 or cy2), while the expected behavior is that (I think) urX.undo() should undo the last action performed on cyX
It seems like that this extension is not working as expected when it is used by by multiple Cytoscape.js instances.
I mean if you create 2 different Cytoscape.js instances as
cy1
andcy2
and initialize the extension on these instances asur1
andur2
as below:then
ur1.undo()
andur2.undo()
does the same thing (undo the last action performed oncy1
orcy2
), while the expected behavior is that (I think)urX.undo()
should undo the last action performed oncyX
The reason must be that in the following few lines (https://github.com/iVis-at-Bilkent/cytoscape.js-undo-redo/blob/master/cytoscape-undo-redo.js#L11)
cy
,undoStack
,redoStack
andactions
are defined once while registering the extension. I suppose that they must be defined per Cytoscape.js instance.