summaryrefslogtreecommitdiff
path: root/lib/js
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 09:33:48 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 09:33:48 -0400
commit29f71e629bfe700a4bfcc7d2018bdab305d6fc3e (patch)
treea2cae7eab132b9d3a0e2a1761daa414b869cdf3e /lib/js
parentf2fff6993d2b138c2efc5cadaa53ecbdb1c2e1b3 (diff)
cselect
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index a29914b9..5482c2a5 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -281,7 +281,7 @@ function dyn(s) {
populate(x);
}
-function inp(t, s) {
+function inp(t, s, content) {
var x = document.createElement(t);
x.dead = false;
x.signal = ss(s);
@@ -289,7 +289,13 @@ function inp(t, s) {
x.recreate = function(v) { if (x.value != v) x.value = v; };
populate(x);
addNode(x);
- x.onkeyup = function() { sv(s, x.value) };
+ if (t == "select") {
+ x.onchange = function() { sv(s, x.value) };
+ x.innerHTML = content;
+ sv(s, x.value);
+ } else
+ x.onkeyup = function() { sv(s, x.value) };
+
return x;
}