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

Proper jQuery plugin #29

Closed
eych opened this issue Sep 16, 2011 · 1 comment
Closed

Proper jQuery plugin #29

eych opened this issue Sep 16, 2011 · 1 comment

Comments

@eych
Copy link

eych commented Sep 16, 2011

Hello.

I guess I have a pretty specific setup when the JS logic that I create loads externally into a 3rd party site (it is used to display a widget on a 3rd party site). I try not to use the global window.* namespace at all, because it is not mine in my case. I am also using jQuery which allows me to completely remove it from the global namespace and just keep a reference in my local variable ( with jQuery.noConflict(true) ).

Spinner by default always assigns itself to window.Spinner which is a problem for me. I've solved this so far just by passing "jQuery" instead of "window" to the main Spinner's anonymous function and thus make it add itself to jQuery.Spinner without messing much with the main Spinner's code.

This is almost fine, but I don't like that I can forget to do this change on the next Spinner update and thus break everything. If Spinner was available as a proper jQuery plugin (and thus only use the jQuery's own namespace) it would be a perfect solution.

Thanks for considering this! :)

@fgnass
Copy link
Owner

fgnass commented Apr 2, 2013

Spin.js is now a UMD module and can be loaded with AMD or CommonJS loaders to keep the global namespace clean.

@fgnass fgnass closed this as completed Apr 2, 2013
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

2 participants