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

Non-global access to SVG in _setupSVGLinks #5

Open
davedupplaw opened this issue May 27, 2017 · 0 comments
Open

Non-global access to SVG in _setupSVGLinks #5

davedupplaw opened this issue May 27, 2017 · 0 comments
Assignees

Comments

@davedupplaw
Copy link
Owner

From website comment:

we are using your plugin in one of our apps and it works great. The only thing is loading the thermometer into a dynamic html element. For that I have done a small change making sure that the plugin does not work in a global context when accessing svg elements.

I have replaced the following lines in the _setupSVGLinks-method:

this.liquidTop = $('#'+id+'_LiquidTop path');
this.neckLiquid = $('#'+id+'_NeckLiquid path');
this.bowlLiquid = $('#'+id+'_BowlLiquid path');
this.topText = $('#'+id+'_TopText');
this.bottomText = $('#'+id+'_BottomText');
this.bowlGlass = $('#'+id+'_BowlGlass');
this.neckGlass = $('#'+id+'_NeckGlass');
this.ticks = $('#'+id+'_Ticks');

with the following lines:

this.liquidTop = svg.find('#'+id+'_LiquidTop path');
this.neckLiquid = svg.find('#'+id+'_NeckLiquid path');
this.bowlLiquid = svg.find('#'+id+'_BowlLiquid path');
this.topText = svg.find('#'+id+'_TopText');
this.bottomText = svg.find('#'+id+'_BottomText');
this.bowlGlass = svg.find('#'+id+'_BowlGlass');
this.neckGlass = svg.find('#'+id+'_NeckGlass');
this.ticks = svg.find('#'+id+'_Ticks');

This change works fine for us and should also work fine in all other cases. Maybe you can add this change to your plugin as well.

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

No branches or pull requests

1 participant