Closed damiencorpataux closed 10 years ago
It seems that the plugin data is somehow shared. Which should not.
A fix would be not to store start/end values in the plugin data. But this solution is not acceptable, because plugin data should not be shared amongst elements.
Investigation needed.
Well, obviously the plugin data object is shared amongst the elements that where instanciated together, ie.
// These share the same data object
$($('img').splice(0,3)).zoomy({connector:'smokeping'});
// This (it's alone) share the object data with itself
$($('img').splice(-1)).zoomy({connector:'smokeping'});
Therefore, we cannot store start and end in the plugin data because it has to be different for each element (even if initialized together as shown above).
Edit: after a short test, it seems that the data object is not shared. There must be a typo or bug in code. Try to rewrite plugin base and track this issue along the way.
SIMPLY MOVE THE DATA OBJECT CREATION INSIDE THE RETURN EACH LOOP, sorry for screaming.
The data object is created once and then REFERENCED by the given dom elements. That's why they act as static property. Dumbly.
When using the plugin on multiple graphs, zooming on a graph messes up the others graph start/end.
Use case: