MCPcopy Create free account
hub / github.com/d35ha/CallObfuscator / initNavTree

Function initNavTree

docs/html/navtree.js:484–545  ·  view source on GitHub ↗
(toroot,relpath)

Source from the content-addressed store, hash-verified

482});
483
484function initNavTree(toroot,relpath)
485{
486 var o = new Object();
487 o.toroot = toroot;
488 o.node = new Object();
489 o.node.li = document.getElementById("nav-tree-contents");
490 o.node.childrenData = NAVTREE;
491 o.node.children = new Array();
492 o.node.childrenUL = document.createElement("ul");
493 o.node.getChildrenUL = function() { return o.node.childrenUL; };
494 o.node.li.appendChild(o.node.childrenUL);
495 o.node.depth = 0;
496 o.node.relpath = relpath;
497 o.node.expanded = false;
498 o.node.isLast = true;
499 o.node.plus_img = document.createElement("span");
500 o.node.plus_img.className = 'arrow';
501 o.node.plus_img.innerHTML = arrowRight;
502
503 if (localStorageSupported()) {
504 var navSync = $('#nav-sync');
505 if (cachedLink()) {
506 showSyncOff(navSync,relpath);
507 navSync.removeClass('sync');
508 } else {
509 showSyncOn(navSync,relpath);
510 }
511 navSync.click(function(){ toggleSyncButton(relpath); });
512 }
513
514 if (loadTriggered) { // load before ready
515 navTo(o,toroot,hashUrl(),relpath);
516 showRoot();
517 } else { // ready before load
518 loadObject = o;
519 loadToRoot = toroot;
520 loadUrl = hashUrl();
521 loadRelPath = relpath;
522 readyTriggered=true;
523 }
524
525 $(window).bind('hashchange', function(){
526 if (window.location.hash && window.location.hash.length>1){
527 var a;
528 if ($(location).attr('hash')){
529 var clslink=stripPath(pathName())+':'+hashValue();
530 a=$('.item a[class$="'+clslink.replace(/</g,'\\3c ')+'"]');
531 }
532 if (a==null || !$(a).parent().parent().hasClass('selected')){
533 $('.item').removeClass('selected');
534 $('.item').removeAttr('id');
535 }
536 var link=stripPath2(pathName());
537 navTo(o,link,hashUrl(),relpath);
538 } else if (!animationInProgress) {
539 $('#doc-content').scrollTop(0);
540 $('.item').removeClass('selected');
541 $('.item').removeAttr('id');

Callers

nothing calls this directly

Calls 12

localStorageSupportedFunction · 0.85
cachedLinkFunction · 0.85
showSyncOffFunction · 0.85
showSyncOnFunction · 0.85
toggleSyncButtonFunction · 0.85
navToFunction · 0.85
hashUrlFunction · 0.85
showRootFunction · 0.85
stripPathFunction · 0.85
pathNameFunction · 0.85
hashValueFunction · 0.85
stripPath2Function · 0.85

Tested by

no test coverage detected