aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 4ef77599..b8ebc1c6 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -815,6 +815,7 @@ function dyn(pnode, s) {
var dummy = document.createElement("body");
dummy.innerHTML = "<table>" + html + "</table>";
+ runScripts(dummy);
var table = x.parentNode;
if (table) {
@@ -842,12 +843,12 @@ function dyn(pnode, s) {
for (var node = tbody.firstChild; node; node = next) {
next = node.nextSibling;
table.insertBefore(node, x);
- runScripts(node);
}
}
} else if (pnode == "tr") {
var dummy = document.createElement("body");
dummy.innerHTML = "<table><tr>" + html + "</tr></table>";
+ runScripts(dummy);
var table = x.parentNode;
if (table) {
@@ -865,15 +866,14 @@ function dyn(pnode, s) {
for (var node = tr.firstChild; node; node = next) {
next = node.nextSibling;
table.insertBefore(node, x);
- runScripts(node);
}
}
} else {
firstChild = document.createElement("span");
firstChild.innerHTML = html;
+ runScripts(firstChild);
if (x.parentNode)
x.parentNode.insertBefore(firstChild, x);
- runScripts(firstChild);
}
};
@@ -1863,12 +1863,14 @@ function fresh() {
}
function giveFocus(id) {
- var node = document.getElementById(id);
+ window.setTimeout(function() {
+ var node = document.getElementById(id);
- if (node)
- node.focus();
- else
- er("Tried to give focus to ID not used in document: " + id);
+ if (node)
+ node.focus();
+ else
+ er("Tried to give focus to ID not used in document: " + id);
+ }, 0);
}