Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ee8c7f77
authored
2012-05-13 23:51:46 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Set input value for radio buttons as el.checked.
1 parent
0c9223d6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletions
lib/rivets.js
src/rivets.coffee
lib/rivets.js
View file @
ee8c7f7
...
...
@@ -25,6 +25,7 @@
case
'select-one'
:
return
el
.
value
;
case
'checkbox'
:
case
'radio'
:
return
el
.
checked
;
}
};
...
...
src/rivets.coffee
View file @
ee8c7f7
...
...
@@ -17,7 +17,7 @@ registerBinding = (el, adapter, type, context, keypath) ->
getInputValue
=
(
el
)
->
switch
el
.
type
when
'text'
,
'textarea'
,
'password'
,
'select-one'
then
el
.
value
when
'checkbox'
then
el
.
checked
when
'checkbox'
,
'radio'
then
el
.
checked
attributeBinding
=
(
attr
)
->
(
el
,
value
)
->
if
value
then
el
.
setAttribute
attr
,
value
else
el
.
removeAttribute
attr
...
...
Please
register
or
sign in
to post a comment