diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-08-23 12:35:09 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-08-23 13:38:23 (GMT) |
commit | fda8427000640072eef6584988e1be5887db3c48 (patch) | |
tree | 776efd625a2b6733025c015b6411a20b43b5651f /src/navtree_js.h | |
parent | 16bc7735b18c77ceee17fc06f04a73aca7e48e13 (diff) | |
download | Doxygen-fda8427000640072eef6584988e1be5887db3c48.zip Doxygen-fda8427000640072eef6584988e1be5887db3c48.tar.gz Doxygen-fda8427000640072eef6584988e1be5887db3c48.tar.bz2 |
Made a couple of minor performance tweeks to navtree.js
Diffstat (limited to 'src/navtree_js.h')
-rw-r--r-- | src/navtree_js.h | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/src/navtree_js.h b/src/navtree_js.h index 1ad83d3..bd03629 100644 --- a/src/navtree_js.h +++ b/src/navtree_js.h @@ -1,3 +1,5 @@ +"var SYNCONMSG = 'click to disable panel synchronisation';\n" +"var SYNCOFFMSG = 'click to enable panel synchronisation';\n" "var navTreeSubIndices = new Array();\n" "\n" "function getData(varName)\n" @@ -78,12 +80,12 @@ " var level=-1;\n" " var n = node;\n" " while (n.parentNode) { level++; n=n.parentNode; }\n" -" var imgNode = document.createElement(\"img\");\n" -" imgNode.style.paddingLeft=(16*level).toString()+'px';\n" -" imgNode.width = 16;\n" -" imgNode.height = 22;\n" -" imgNode.border = 0;\n" " if (node.childrenData) {\n" +" var imgNode = document.createElement(\"img\");\n" +" imgNode.style.paddingLeft=(16*level).toString()+'px';\n" +" imgNode.width = 16;\n" +" imgNode.height = 22;\n" +" imgNode.border = 0;\n" " node.plus_img = imgNode;\n" " node.expandToggle = document.createElement(\"a\");\n" " node.expandToggle.href = \"javascript:void(0)\";\n" @@ -100,8 +102,12 @@ " domNode.appendChild(node.expandToggle);\n" " imgNode.src = node.relpath+\"ftv2pnode.png\";\n" " } else {\n" -" imgNode.src = node.relpath+\"ftv2node.png\";\n" -" domNode.appendChild(imgNode);\n" +" var span = document.createElement(\"span\");\n" +" span.style.display = 'inline-block';\n" +" span.style.width = 16*(level+1)+'px';\n" +" span.style.height = '22px';\n" +" span.innerHTML = ' ';\n" +" domNode.appendChild(span);\n" " } \n" "}\n" "\n" @@ -320,7 +326,7 @@ " if (!node.childrenVisited) {\n" " getNode(o, node);\n" " }\n" -" $(node.getChildrenUL()).show();\n" +" $(node.getChildrenUL()).css({'display':'block'});\n" " if (node.isLast) {\n" " node.plus_img.src = node.relpath+\"ftv2mlastnode.png\";\n" " } else {\n" @@ -352,8 +358,22 @@ " }\n" "}\n" "\n" +"function removeToInsertLater(element) {\n" +" var parentNode = element.parentNode;\n" +" var nextSibling = element.nextSibling;\n" +" parentNode.removeChild(element);\n" +" return function() {\n" +" if (nextSibling) {\n" +" parentNode.insertBefore(element, nextSibling);\n" +" } else {\n" +" parentNode.appendChild(element);\n" +" }\n" +" };\n" +"}\n" +"\n" "function getNode(o, po)\n" "{\n" +" var insertFunction = removeToInsertLater(po.li);\n" " po.childrenVisited = true;\n" " var l = po.childrenData.length-1;\n" " for (var i in po.childrenData) {\n" @@ -361,6 +381,7 @@ " po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2],\n" " i==l);\n" " }\n" +" insertFunction();\n" "}\n" "\n" "function gotoNode(o,subIndex,root,hash,relpath)\n" @@ -466,6 +487,7 @@ "\n" " $(window).load(function(){\n" " navTo(o,toroot,window.location.hash,relpath);\n" +" showRoot();\n" " });\n" "\n" " $(window).bind('hashchange', function(){\n" @@ -489,7 +511,5 @@ " navTo(o,toroot,window.location.hash,relpath);\n" " }\n" " })\n" -"\n" -" $(window).load(showRoot);\n" "}\n" "\n" |