diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2012-12-26 15:59:17 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2012-12-26 15:59:17 (GMT) |
commit | 48f4de5c47d55b6622b6fdc9b5c288e19d5692f9 (patch) | |
tree | 629c4681a5158d26512b815623754b33165d8d23 /src/navtree.js | |
parent | fee4053bd3dd075a2dd2cba4da8166ec5307eadd (diff) | |
download | Doxygen-48f4de5c47d55b6622b6fdc9b5c288e19d5692f9.zip Doxygen-48f4de5c47d55b6622b6fdc9b5c288e19d5692f9.tar.gz Doxygen-48f4de5c47d55b6622b6fdc9b5c288e19d5692f9.tar.bz2 |
Release-1.8.3
Diffstat (limited to 'src/navtree.js')
-rw-r--r-- | src/navtree.js | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/src/navtree.js b/src/navtree.js index d4b241a..3d8134a 100644 --- a/src/navtree.js +++ b/src/navtree.js @@ -75,24 +75,22 @@ function getScript(scriptName,func,show) function createIndent(o,domNode,node,level) { - if (node.parentNode && node.parentNode.parentNode) { - createIndent(o,domNode,node.parentNode,level+1); - } + var level=-1; + var n = node; + while (n.parentNode) { level++; n=n.parentNode; } var imgNode = document.createElement("img"); - imgNode.width = 16; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.width = 16; imgNode.height = 22; - if (level==0 && node.childrenData) { + imgNode.border = 0; + if (node.childrenData) { node.plus_img = imgNode; node.expandToggle = document.createElement("a"); node.expandToggle.href = "javascript:void(0)"; node.expandToggle.onclick = function() { if (node.expanded) { $(node.getChildrenUL()).slideUp("fast"); - if (node.isLast) { - node.plus_img.src = node.relpath+"ftv2plastnode.png"; - } else { - node.plus_img.src = node.relpath+"ftv2pnode.png"; - } + node.plus_img.src = node.relpath+"ftv2pnode.png"; node.expanded = false; } else { expandNode(o, node, false, false); @@ -100,33 +98,11 @@ function createIndent(o,domNode,node,level) } node.expandToggle.appendChild(imgNode); domNode.appendChild(node.expandToggle); + imgNode.src = node.relpath+"ftv2pnode.png"; } else { + imgNode.src = node.relpath+"ftv2node.png"; domNode.appendChild(imgNode); - } - if (level==0) { - if (node.isLast) { - if (node.childrenData) { - imgNode.src = node.relpath+"ftv2plastnode.png"; - } else { - imgNode.src = node.relpath+"ftv2lastnode.png"; - domNode.appendChild(imgNode); - } - } else { - if (node.childrenData) { - imgNode.src = node.relpath+"ftv2pnode.png"; - } else { - imgNode.src = node.relpath+"ftv2node.png"; - domNode.appendChild(imgNode); - } - } - } else { - if (node.isLast) { - imgNode.src = node.relpath+"ftv2blank.png"; - } else { - imgNode.src = node.relpath+"ftv2vertline.png"; - } - } - imgNode.border = "0"; + } } var animationInProgress = false; @@ -364,7 +340,7 @@ function showNode(o, node, index, hash) },true); } else { var rootBase = stripPath(o.toroot.replace(/\..+$/, '')); - if (rootBase=="index" || rootBase=="pages") { + if (rootBase=="index" || rootBase=="pages" || rootBase=="search") { expandNode(o, n, true, true); } selectAndHighlight(hash,n); @@ -420,6 +396,7 @@ function navTo(o,root,hash,relpath) var url=root+hash; var i=-1; while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index if (navTreeSubIndices[i]) { gotoNode(o,i,root,hash,relpath) } else { |