Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$el.data('SVGPan') never evaluates #22

Open
webmutation opened this issue Jul 14, 2014 · 0 comments
Open

$el.data('SVGPan') never evaluates #22

webmutation opened this issue Jul 14, 2014 · 0 comments

Comments

@webmutation
Copy link

I may be missing something but after debugging the initialization code for svgPan, this expression $el.data('SVGPan') never evaluates to false and as a consequence neither does this: if ($el.is('svg') && $el.data('SVGPan') !== true) {

so in practice using the demo.html file and doing

$('svg').svgPan('viewport');
$('svg').svgPan('viewport');
$('svg').svgPan('viewport');
$('svg').svgPan('viewport');
$('svg').svgPan('viewport');

It actually never detects that the plugin is already initialized, and initializes the plugin multiple times duplicates the plugin behavior... calls the event handling 5x

I came across this because I have to delete the viewport and recreate multiple times, to handle window resize, and was getting strange behaviour due to having this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant