[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/rotterdam - xmltree.js:1.11

Godefroid Chapelle gotcha@swing.be
Wed, 15 Jan 2003 05:08:20 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/skins/rotterdam
In directory cvs.zope.org:/tmp/cvs-serv8836

Modified Files:
	xmltree.js 
Log Message:
second page request bug corrected 


=== Zope3/src/zope/app/browser/skins/rotterdam/xmltree.js 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/xmltree.js:1.10	Tue Jan 14 17:15:21 2003
+++ Zope3/src/zope/app/browser/skins/rotterdam/xmltree.js	Wed Jan 15 05:08:17 2003
@@ -19,7 +19,7 @@
 // globals
 var baseurl;
 var navigationTree;
-
+var docNavTree;
 var loglevel = LG_NOLOG;
 
 
@@ -315,6 +315,7 @@
 
 function loadtree (rooturl, thisbaseurl) {
         baseurl = rooturl;  // Global baseurl
+        docNavTree = document.getElementById('navtreecontents');
   
 	var url = thisbaseurl + SINGLE_BRANCH_TREE_VIEW;
         loadtreexml(url, null);
@@ -335,10 +336,9 @@
                 var data = responseXML.documentElement;
                 if (node == null) {
                         //[top] node
-                        var docNavTree = document.getElementById('navtreecontents');
                         removeChildren(docNavTree);
                         addNavigationTreeNodes(data, null, 1);
-                        docNavTree.appendChild(navigationTree.domNode);
+//                        docNavTree.appendChild(navigationTree.domNode);
                         }
                 else {
                         //expanding nodes
@@ -366,6 +366,7 @@
                 }
         }       
 
+
 function createPresentationNodes(title, targetUrl, icon_url, length) {
         // create nodes hierarchy for one collection (without children)
         
@@ -374,7 +375,10 @@
         // create elem for item icon
         var iconElem = document.createElement('icon');
         expandElem.appendChild(iconElem);
-        iconElem.style.backgroundImage = 'url("' + icon_url + '")';
+        // Mozilla tries to infer an URL if url is empty and reloads containing page
+        if (icon_url != '')  {
+                iconElem.style.backgroundImage = 'url("' + icon_url + '")';
+                }
         // create link
         var linkElem = document.createElement('a');
         var titleTextNode = document.createTextNode(title);
@@ -410,6 +414,7 @@
                 elemPath = basePath;
                 newelem.style.marginLeft = '0px';
                 navigationTree = navTreeNode;
+                docNavTree.appendChild(newelem);
                 }
         else {
                 elemTitle = source.getAttribute('name');
@@ -435,8 +440,6 @@
                 var numchildren = children.length;
                 for (var i=0; i< numchildren; i++) {
                         var navTreeNodeChild =  createNavigationTreeNode(children[i], navTreeNode.path, deep); 
-                        var newchild = navTreeNodeChild.domNode;
-                        newelem.appendChild(newchild);
                         navTreeNode.appendChild(navTreeNodeChild);
                         }
                 if (numchildren) {