Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

toggleButtons can only be called after inserting the checkbox into DOM #35

Open
KidkArolis opened this Issue · 4 comments

4 participants

@KidkArolis

I see $('.toggle-button') selector is used in the code, which means, that if the toggleButtons was called on a checkbox that's not yet inserted into DOM, it won't attach any event listeners.

@KidkArolis

What about doing smth like this instead?

$element.closest(".toggle-button")
@oskarols

+1, this matter a lot when using it with frameworks like backbone.

@jessebsmith

+1, I'm unable to get this to work with some knockoutjs when I use data-binds. More specifically with use of the "with" binding.

@nostalgiaz
Owner

I like this idea. Can you send me a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.