MCPcopy Create free account
hub / github.com/chigraph/chigraph / showNode

Function showNode

docs/navtree.js:325–364  ·  view source on GitHub ↗
(o, node, index, hash)

Source from the content-addressed store, hash-verified

323}
324
325function showNode(o, node, index, hash)
326{
327 if (node && node.childrenData) {
328 if (typeof(node.childrenData)==='string') {
329 var varName = node.childrenData;
330 getScript(node.relpath+varName,function(){
331 node.childrenData = getData(varName);
332 showNode(o,node,index,hash);
333 },true);
334 } else {
335 if (!node.childrenVisited) {
336 getNode(o, node);
337 }
338 $(node.getChildrenUL()).css({'display':'block'});
339 node.plus_img.innerHTML = arrowDown;
340 node.expanded = true;
341 var n = node.children[o.breadcrumbs[index]];
342 if (index+1<o.breadcrumbs.length) {
343 showNode(o,n,index+1,hash);
344 } else {
345 if (typeof(n.childrenData)==='string') {
346 var varName = n.childrenData;
347 getScript(n.relpath+varName,function(){
348 n.childrenData = getData(varName);
349 node.expanded=false;
350 showNode(o,node,index,hash); // retry with child node expanded
351 },true);
352 } else {
353 var rootBase = stripPath(o.toroot.replace(/\..+$/, ''));
354 if (rootBase=="index" || rootBase=="pages" || rootBase=="search") {
355 expandNode(o, n, true, true);
356 }
357 selectAndHighlight(hash,n);
358 }
359 }
360 }
361 } else {
362 selectAndHighlight(hash);
363 }
364}
365
366function removeToInsertLater(element) {
367 var parentNode = element.parentNode;

Callers 1

gotoNodeFunction · 0.85

Calls 6

getScriptFunction · 0.85
getDataFunction · 0.85
getNodeFunction · 0.85
stripPathFunction · 0.85
expandNodeFunction · 0.85
selectAndHighlightFunction · 0.85

Tested by

no test coverage detected