Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
fix checkbox default function
Browse files Browse the repository at this point in the history
  • Loading branch information
0x8890 committed May 30, 2016
1 parent d2a83a0 commit d797ba7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ function bindObject (obj, def) {
// Default DOM mutation functions.
function replaceText (node, value) { node.textContent = value }
function replaceValue (node, value) { node.value = value }
function replaceChecked (context) { node.checked = context.value }
function replaceChecked (node, value) {
if (value) node.checked = 'checked'
else node.removeAttribute('checked')
}

// Private static property, used for checking parent binding function.
Object.defineProperty(replaceText, '__isDefault', { value: true })
Expand Down

0 comments on commit d797ba7

Please sign in to comment.