Skip to content

Commit 0949c21

Browse files
author
Sven Petersen
committed
version dropdown
1 parent d5c3d38 commit 0949c21

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

src/css/nav.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,19 @@ html.is-clipped--nav {
256256
opacity: 0.9;
257257
font-weight: var(--body-font-weight-bold);
258258
}
259+
260+
.nav-menu .title-wrapper {
261+
display: flex;
262+
}
263+
264+
.nav-menu .title-wrapper h3 {
265+
flex-grow: 2;
266+
}
267+
268+
.nav-menu .title-wrapper .page-versions {
269+
flex-grow: 1;
270+
min-width: 85px;
271+
margin-right: 0;
272+
margin-left: 5px;
273+
text-align: end;
274+
}

src/partials/nav-menu.hbs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
{{#with page.navigation}}
22
<div class="nav-panel-menu is-active" data-panel="menu">
33
<nav class="nav-menu">
4-
{{#with @root.page.componentVersion}}
5-
<h3 class="title"><a href="{{{relativize ./url}}}">{{./title}}</a></h3>
6-
{{/with}}
7-
{{> nav-tree navigation=this}}
4+
<div class="title-wrapper">
5+
{{#with @root.page.componentVersion}}
6+
<h3 class="title"><a href="{{{relativize ./url}}}">{{./title}}</a></h3>
7+
{{/with}}
8+
{{#with @root.page.versions}}
9+
<div class="page-versions">
10+
<button class="version-menu-toggle" title="Show other versions of page">{{@root.page.componentVersion.displayVersion}}</button>
11+
<div class="version-menu">
12+
{{#each this}}
13+
<a class="version
14+
{{~#if (eq ./version @root.page.version)}} is-current{{/if~}}
15+
{{~#if ./missing}} is-missing{{/if}}" href="{{{relativize ./url}}}">{{./displayVersion}}</a>
16+
{{/each}}
17+
</div>
18+
</div>
19+
{{/with}}
20+
</div>
21+
{{> nav-tree navigation=this}}
822
</nav>
923
</div>
1024
{{/with}}

0 commit comments

Comments
 (0)