hooking up in-page navigation menu

This commit is contained in:
Kohsuke Kawaguchi committed 2012-02-28 11:01:37 +09:00
1 parent ea27259ae9
commit fd251de507
2 files changed
+10 -5

No files matched your search

@@ -36,10 +36,15 @@ THE SOFTWARE.
</style>
<script>
window.addEventListener("load",function(){
breadcrumbs.attachMenu('inpage-nav',
new breadcrumbs.ContextMenu().add(
'/',
'${rootURL}${h.resourcePath}/images/24x24/gear.png',"hello world"))
/** @type section.SectionNode */
var outline = section.buildTree();
var menu = new breadcrumbs.ContextMenu();
$A(outline.children).each(function (e) {
if (!e.section.id)
e.section.setAttribute("id","section"+(iota++));
menu.add('#'+e.section.id,null,e.getHTML());
});
breadcrumbs.attachMenu('inpage-nav',menu);
});
</script>
<div class="behavior-loading">${%LOADING}</div>
+1 -1
View File
@@ -35,7 +35,7 @@ var section = (function (){
* For root node, the 'section' property refers to null.
*/
"buildTree" : function(root) {
root = $(root);
root = $(root||document.body);
/**
* Recursively visit elements and find all section headers.