Skip to content

Commit

Permalink
Improve tab navigation on navigation tree
Browse files Browse the repository at this point in the history
For the HTML outout, when GENERATE_TREEVIEW=YES and pressing tab/enter keys
  • Loading branch information
doxygen committed Jul 31, 2023
1 parent 9329643 commit db82b05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion templates/html/navtree.css
Expand Up @@ -42,7 +42,6 @@
text-decoration:none;
padding:0px;
margin:0px;
outline:none;
}

#nav-tree .label {
Expand Down
21 changes: 12 additions & 9 deletions templates/html/navtree.js
Expand Up @@ -94,7 +94,7 @@ function cachedLink()
}
}

function getScript(scriptName,func,show)
function getScript(scriptName,func)
{
var head = document.getElementsByTagName("head")[0];
var script = document.createElement('script');
Expand Down Expand Up @@ -124,7 +124,7 @@ function createIndent(o,domNode,node,level)
node.plus_img.innerHTML=arrowRight;
node.expanded = false;
} else {
expandNode(o, node, false, false);
expandNode(o, node, false, true);
}
}
node.expandToggle.appendChild(imgNode);
Expand Down Expand Up @@ -265,22 +265,25 @@ function showRoot()
})();
}

function expandNode(o, node, imm, showRoot)
function expandNode(o, node, imm, setFocus)
{
if (node.childrenData && !node.expanded) {
if (typeof(node.childrenData)==='string') {
var varName = node.childrenData;
getScript(node.relpath+varName,function(){
node.childrenData = getData(varName);
expandNode(o, node, imm, showRoot);
}, showRoot);
expandNode(o, node, imm, setFocus);
});
} else {
if (!node.childrenVisited) {
getNode(o, node);
}
$(node.getChildrenUL()).slideDown("fast");
node.plus_img.innerHTML = arrowDown;
node.expanded = true;
if (setFocus) {
$(node.expandToggle).focus();
}
}
}
}
Expand Down Expand Up @@ -344,7 +347,7 @@ function showNode(o, node, index, hash)
getScript(node.relpath+varName,function(){
node.childrenData = getData(varName);
showNode(o,node,index,hash);
},true);
});
} else {
if (!node.childrenVisited) {
getNode(o, node);
Expand All @@ -362,11 +365,11 @@ function showNode(o, node, index, hash)
n.childrenData = getData(varName);
node.expanded=false;
showNode(o,node,index,hash); // retry with child node expanded
},true);
});
} else {
var rootBase = stripPath(o.toroot.replace(/\..+$/, ''));
if (rootBase=="index" || rootBase=="pages" || rootBase=="search") {
expandNode(o, n, true, true);
expandNode(o, n, true, false);
}
selectAndHighlight(hash,n);
}
Expand Down Expand Up @@ -444,7 +447,7 @@ function navTo(o,root,hash,relpath)
if (navTreeSubIndices[i]) {
gotoNode(o,i,root,hash,relpath);
}
},true);
});
}
}

Expand Down

0 comments on commit db82b05

Please sign in to comment.