aboutsummaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorEinar Egilsson <einar@einaregilsson.com>2019-12-11 15:06:42 +0000
committerEinar Egilsson <einar@einaregilsson.com>2019-12-11 15:06:42 +0000
commit0fcc8c5e734d5e3ea769c5ef7be9f2200c3aca06 (patch)
treef724e430286791f867cf0c42c039ec362a04eac0 /js/util.js
parentb53d093463e94096f16f0fd7656fc88d642faa3d (diff)
More fixes after removing angular
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js
index d8ad0db..43eaa69 100644
--- a/js/util.js
+++ b/js/util.js
@@ -12,8 +12,10 @@ function dataBind(el, dataObject) {
if (tag.tagName.toLowerCase() === 'input') {
if (tag.getAttribute('type').toLowerCase() === 'radio') {
tag.checked = dataObject[prop] === tag.getAttribute('value');
- } else {
- tag.value = dataObject[prop];
+ } else if (tag.getAttribute('type').toLowerCase() === 'checkbox') {
+ tag.checked = dataObject[prop];
+ } else {
+ tag.value = dataObject[prop];
}
} else if (tag.tagName.toLowerCase() === 'select') {
for (let opt of tag.querySelectorAll('option')) {