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

Making Ladda a AMD/Common.js Module #7

Closed
wants to merge 3 commits into from
Closed

Making Ladda a AMD/Common.js Module #7

wants to merge 3 commits into from

Conversation

sloped
Copy link

@sloped sloped commented Jun 7, 2013

This commit moves spin.js into it's own file and makes define or export itself as module if using a module loader. otherwise it loads into the window global as before. Retains the exact same functionality but makes loading it cleaner in many environments.

/* Browser global */
else root.Ladda = factory()
}
(this, function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To allow for loading the spin.js file dynamically via requirejs, I had to pass Spinner down into the function with:

(this, function( Spinner ) {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, I didn't commit the final implementation. Just pushed a fix.

@sloped
Copy link
Author

sloped commented Jun 12, 2013

Updated to include Spinner in the closures functional call.

@rafi
Copy link

rafi commented Jun 12, 2013

+1 for AMD, but why does it look from diff like you changed the whole ladda.js file ? You've also removed Hakim's copyright...

@sloped
Copy link
Author

sloped commented Jun 13, 2013

Weird, I'm going to clean this up and do this on a different request.

@sloped sloped closed this Jun 13, 2013
@sloped
Copy link
Author

sloped commented Jun 13, 2013

Moved this to #16

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

Successfully merging this pull request may close these issues.

None yet

3 participants