comparison lib/js/urweb.js @ 811:50b4825115f0

Fix initialization of cselect from source
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 May 2009 16:59:24 -0400
parents c1f8963ebb18
children 2fbd1ac2f04b
comparison
equal deleted inserted replaced
810:c1f8963ebb18 811:50b4825115f0
290 x.sources = null; 290 x.sources = null;
291 x.recreate = function(v) { if (x.value != v) x.value = v; }; 291 x.recreate = function(v) { if (x.value != v) x.value = v; };
292 populate(x); 292 populate(x);
293 addNode(x); 293 addNode(x);
294 if (t == "select") { 294 if (t == "select") {
295 x.innerHTML = content;
296 x.value = s.data;
295 x.onchange = function() { sv(s, x.value) }; 297 x.onchange = function() { sv(s, x.value) };
296 x.innerHTML = content; 298 } else {
297 sv(s, x.value); 299 x.value = s.data;
298 } else
299 x.onkeyup = function() { sv(s, x.value) }; 300 x.onkeyup = function() { sv(s, x.value) };
301 }
300 302
301 return x; 303 return x;
302 } 304 }
303 305
304 function addOnChange(x, f) { 306 function addOnChange(x, f) {