From 21a8ce98948d2560130147e952411b4e3d4076b9 Mon Sep 17 00:00:00 2001
From: Danny Yoo
Date: Mon, 5 Sep 2011 12:13:31 -0400
Subject: [PATCH] trying to make the initial render a little more reliable
---
web-world/js-impl.js | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/web-world/js-impl.js b/web-world/js-impl.js
index 5fefa2e..0981a03 100644
--- a/web-world/js-impl.js
+++ b/web-world/js-impl.js
@@ -418,17 +418,13 @@
top.empty();
// Special case: if this.top is an html, we merge into the
// existing page.
- if (this.top.children("head").children("title").length !== 0) {
+ if (this.top.children("title").length !== 0) {
$(document.head).find('title').remove();
}
- $(document.head).append(this.top.find("head").children());
+ $(document.head).append(this.top.children("title"));
+ $(document.head).append(this.top.children("link"));
- if (this.top.find("body").length > 0) {
- top.append(this.top.find("body").children());
- this.top = top;
- } else {
- top.append(this.top);
- }
+ top.append(this.top);
};
View.prototype.addEventHandler = function(handler) {
@@ -466,7 +462,7 @@
var parseStringAsHtml = function(str) {
- var dom = $("").append($(str));
+ var dom = $('
').append($(str));
return dom;
};