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

Changed how the UI's kept in sync #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gkostov
Copy link

@gkostov gkostov commented Jul 17, 2014

This allows the UI to stay in sync even if the INPUT is toggled by code
outside of the plugin (either by JS or by the browser if the user clicks
a wrapping LABEL for example)

Calling fakeCheckable.toggleClass('checked'); has the downside of not actually syncing the UI but just switching its state which in most cases is fine. But there are also cases when the source INPUT is toggled directly in some of various ways and then the UI can't catch up no matter how many times the user actions on the plugin's DOM elements.

There's only one concern I have about this commit and it relates to my complete ignorance regarding the Knockout library, and being unable to test if ko functionality is affected.

Also in destroy() it seems the source INPUT will be deleted from the DOM so there's no real need to detach events bound to it. But am I wrong?

Cheers

This allows the UI to stay in sync even if the INPUT is toggled by code
outside of the plugin (either by JS or by the browser if the user clicks
a wrapping LABEL for example)
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.

1 participant