Open KidkArolis opened 11 years ago
What about doing smth like this instead?
$element.closest(".toggle-button")
+1, this matter a lot when using it with frameworks like backbone.
+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.
I like this idea. Can you send me a pull request?
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.