diff options
author | Adam Chlipala <adam@chlipala.net> | 2018-06-04 11:51:00 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2018-06-04 11:51:00 -0400 |
commit | e626ef35ebd7d79a820ead03a8d30d5ee090671c (patch) | |
tree | 1f1a2129eff0d6e99f18ec96707720ce30d411ef /lib/js/urweb.js | |
parent | c68da19be2a3fab584973c4a9d0a93035a6d9116 (diff) | |
parent | 71dab68defc48d9be9d1e45e63925d0fb01ebb34 (diff) |
Merge branch 'master' of ssh://github.com/urweb/urweb
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r-- | lib/js/urweb.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index d8198ed0..99b45ec9 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -1205,6 +1205,19 @@ function time(s, name) { return inpt("time", s, name); } +function crad(s) { + if (suspendScripts) + return; + + var x = input(document.createElement("input"), s, + function(x) { return function(v) { x.checked = (x.value === v); }; }, "radio"); + x.onclick = x.onkeyup = x.oninput = x.onchange = x.onpropertychange = function() { sv(s, x.value) }; + setTimeout(function() { + x.defaultChecked = x.checked = (s.data === x.value); + }, 10); + + return x; +} function selectValue(x) { if (x.options.length == 0) |