Skip to content

Comments

Changed how the UI's kept in sync#85

Open
gkostov wants to merge 1 commit intoarthurgouveia:masterfrom
PerformanceHorizonGroup:update-on-element-change
Open

Changed how the UI's kept in sync#85
gkostov wants to merge 1 commit intoarthurgouveia:masterfrom
PerformanceHorizonGroup:update-on-element-change

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