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 the options parameter optional #22

Closed
HelloGravity opened this issue Oct 4, 2015 · 2 comments
Closed

Making the options parameter optional #22

HelloGravity opened this issue Oct 4, 2015 · 2 comments

Comments

@HelloGravity
Copy link
Contributor

When creating an instance of a widget (for example a Modal), why isn't the options parameter optional?

This is my use case:

var modalElement = document.getElementById("myModal");

// this works:
new Modal(modalElement, {}).open();

// this won't work:
new Modal(modalElement).open();

(jsfiddle: http://jsfiddle.net/0w8s27a5/)

my suggestion is to have something like this in each of the constructor functions:

options = options || {};
@thednp
Copy link
Owner

thednp commented Oct 4, 2015

Thanks for the input. I don't know if that's gonna affect the current DATA API or not, but you can try, test and submit a PR, I will have a look at it as soon as I can.

I also intend to fix some issues with IE8 very soon, so stay close.

@thednp
Copy link
Owner

thednp commented Oct 9, 2015

Thanks for the PR. Now gonna go ahead and run local tests and improvements.

@thednp thednp closed this as completed Oct 9, 2015
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

2 participants