Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Setup Checked to trigger a change event when it changes the checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanpalmer committed Aug 2, 2012
1 parent cc30c05 commit f229d1b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
20 changes: 14 additions & 6 deletions src/spine.databind.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,22 @@ class Checked extends Template

if el.attr("type") is "radio"
if result is value
el.attr("checked", "checked")
else
el.removeAttr("checked")
if not el.is(":checked")
el.attr("checked", "checked")
el.trigger("change")
else
if not el.is(":checked")
el.removeAttr("checked")
el.trigger("change")
else
if not result
el.removeAttr("checked")
if result
if not el.is(":checked")
el.attr("checked", "checked")
el.trigger("change")
else
el.attr("checked", "checked")
if el.is(":checked")
el.removeAttr("checked")
el.trigger("change")

DataBind =
binders: [
Expand Down
22 changes: 17 additions & 5 deletions src/spine.databind.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f229d1b

Please sign in to comment.