[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kupu-checkins
Subject:    [kupu-checkins] r11450 - kupu/branch/kupu-1.2/common
From:       guido () codespeak ! net
Date:       2005-04-26 9:57:44
Message-ID: 20050426095744.11A2A27B97 () code1 ! codespeak ! net
[Download RAW message or body]

Author: guido
Date: Tue Apr 26 11:57:43 2005
New Revision: 11450

Modified:
   kupu/branch/kupu-1.2/common/kupubasetools.js
Log:
Fixed bug that made setting titles fail in IE. Thanks to Ken Lalonde for the
bug report and patch.


Modified: kupu/branch/kupu-1.2/common/kupubasetools.js
==============================================================================
--- kupu/branch/kupu-1.2/common/kupubasetools.js	(original)
+++ kupu/branch/kupu-1.2/common/kupubasetools.js	Tue Apr 26 11:57:43 2005
@@ -483,8 +483,19 @@
             title.appendChild(text);
             head.appendChild(title);
         } else {
-            titles[0].childNodes[0].nodeValue = this.titlefield.value;
+            var title = titles[0];
+            // IE6 title has no children, and refuses appendChild.
+            // Delete and recreate the title.
+            if (title.childNodes.length == 0) {
+                title.removeNode(true);
+                title = doc.createElement('title');
+                title.innerText = this.titlefield.value;
+                head.appendChild(title);
+            } else {
+                title.childNodes[0].nodeValue = this.titlefield.value;
+            }
         }
+        document.title = this.titlefield.value;
 
         // let's just fulfill the usecase, not think about more properties
         // set the description

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic