diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2012-01-22 19:51:13 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2012-01-22 19:51:13 (GMT) |
commit | c22d77a7a9c0f26a060a58047f514869a9e0a067 (patch) | |
tree | 082a1fab748f7d6917c9728b6f302bb4757de12d /src/navtree.js | |
parent | fd8b446f8ae60e7d1dc259c6f5fe38c287377d19 (diff) | |
download | Doxygen-c22d77a7a9c0f26a060a58047f514869a9e0a067.zip Doxygen-c22d77a7a9c0f26a060a58047f514869a9e0a067.tar.gz Doxygen-c22d77a7a9c0f26a060a58047f514869a9e0a067.tar.bz2 |
Release-1.7.6.1-20120122
Diffstat (limited to 'src/navtree.js')
-rw-r--r-- | src/navtree.js | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/navtree.js b/src/navtree.js index b0c4936..eb18215 100644 --- a/src/navtree.js +++ b/src/navtree.js @@ -210,6 +210,21 @@ function expandNode(o, node, imm, showRoot) } } +function highlightAnchor() +{ + var anchor = $($(location).attr('hash')); + if (anchor.parent().attr('class')=='memItemLeft'){ + var rows = $('.memberdecls tr[class$=\""'+ + window.location.hash.substring(1)+'"\"]').children(); + rows.effect('highlight',{},1500); + } else if (anchor.parent().is(":header")) { + anchor.parent().effect('highlight',{},1500); + } else { + var targetDiv = anchor.next(); + $(targetDiv).children('.memproto,.memdoc').effect("highlight",{},1500); + } +} + function showNode(o, node, index) { if (node.childrenData && !node.expanded) { @@ -249,15 +264,12 @@ function showNode(o, node, index) if ($(location).attr('hash')) { var link=stripPath($(location).attr('pathname'))+':'+ $(location).attr('hash').substring(1); - a=$('.item a[class*=\""'+link+'"\"]'); + a=$('.item a[class$=\""'+link+'"\"]'); } if (a && a.length) { a.parent().parent().addClass('selected'); a.parent().parent().attr('id','selected'); - var anchor = $($(location).attr('hash')); - var targetDiv = anchor.next(); - $(targetDiv).children('.memproto,.memdoc'). - effect("highlight", {}, 1500); + highlightAnchor(); } else { $(n.itemDiv).addClass('selected'); $(n.itemDiv).attr('id','selected'); @@ -302,7 +314,8 @@ function initNavTree(toroot,relpath) getScript(relpath+"navtreeindex",function(){ var navTreeIndex = eval('NAVTREEINDEX'); if (navTreeIndex) { - o.breadcrumbs = navTreeIndex[toroot]; + var nti = navTreeIndex[toroot+window.location.hash]; + o.breadcrumbs = nti ? nti : navTreeIndex[toroot]; if (o.breadcrumbs==null) o.breadcrumbs = navTreeIndex["index.html"]; o.breadcrumbs.unshift(0); showNode(o, o.node, 0); @@ -311,20 +324,12 @@ function initNavTree(toroot,relpath) $(window).bind('hashchange', function(){ if (window.location.hash && window.location.hash.length>1){ - var anchor = $(window.location.hash); - if (anchor.parent().attr('class')=='memItemLeft'){ - var rows = $('.memberdecls tr[class$=\""'+ - window.location.hash.substring(1)+'"\"]').children(); - rows.effect('highlight',{},1500); - } else { - var targetDiv = anchor.next(); - $(targetDiv).children('.memproto,.memdoc').effect("highlight",{},1500); - } + highlightAnchor(); var a; if ($(location).attr('hash')){ var link=stripPath($(location).attr('pathname'))+':'+ $(location).attr('hash').substring(1); - a=$('.item a[class*=\""'+link+'"\"]'); + a=$('.item a[class$=\""'+link+'"\"]'); } if (a && a.length){ $('.item').removeClass('selected'); |