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

Issue in change event function #222

Closed
rreimi opened this issue Jul 15, 2014 · 2 comments
Closed

Issue in change event function #222

rreimi opened this issue Jul 15, 2014 · 2 comments

Comments

@rreimi
Copy link

rreimi commented Jul 15, 2014

According to docs, If you declare a function in the options change, open and close, the value of this will be the Dropkick object.

It's not working for the change option:

jQuery('.my-select').dropkick({
         change: function() {
                console.log( this ); //object
                console.log( this.data ); //undefined
         },
         open: function() {
                console.log( this ); //the dropkick object
                console.log( this.data ); //works
         }
});

This is a workaround:

If you declare the first argument of you change function, it will contain the reference to the Dropkick object:

jQuery('.my-select').dropkick({
         change: function(dk) {
               console.log( dk ); //the dropkick object
                console.log( dk.data ); //works
         }
});
wwilsman added a commit that referenced this issue Jul 15, 2014
@wwilsman
Copy link
Collaborator

Must've forgotten to update that call in the earlier days of switching to use this.

Thanks for bringing it to our attention; fixed!

@rreimi
Copy link
Author

rreimi commented Jul 15, 2014

Anytime :)

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