Skip to content

Commit

Permalink
Integrate the navigation menu with the cssmenu code.
Browse files Browse the repository at this point in the history
Customizes the navigation tree generation to nest properly and to add the "has-sub" CSS class instead of "tree-view" for root items.
  • Loading branch information
s-ludwig committed Feb 16, 2015
1 parent 9994f34 commit a5415e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion css/ddox.css
Expand Up @@ -82,7 +82,7 @@ col.caption {
min-width: 170pt;
}

#navigation ul.tree-view a.package {
#navigation #cssmenu a.package {
background-image: none;
}

Expand Down
14 changes: 14 additions & 0 deletions dpl-docs/views/ddox.inc.module-tree.dt
@@ -0,0 +1,14 @@
- import ddox.entities;

- void moduleNavTree(Package pack)
- string pack_class = pack is info.rootPackage ? "has-sub" : "tree-view";
- foreach(i, p; pack.packages)
li(class='#{!pack.parent && i == 0 && !info.node.parent || p.isAncestorOf(info.node) ? pack_class : pack_class ~ " collapsed"}')
a.package(href="#")= p !is info.rootPackage ? p.name : null
ul.tree-view
- moduleNavTree(p);
- foreach(m; pack.modules)
li
a.module(href="#{info.linkTo(m)}", class='#{info.node is m || m.isAncestorOf(info.node) ? "selected" : ""}')= m.name

- moduleNavTree(info.rootPackage);

0 comments on commit a5415e2

Please sign in to comment.