Skip to content

Commit fd9ee53

Browse files
fix for service versions & dropdown
1 parent ecd61a1 commit fd9ee53

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

layouts/partials/sidebar.pug

+9-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
// Service Docs
1111
if paths[0] === 'services' && paths[1]
1212
- items = hierarchy.findByPath('/' + paths[0] + '/' + paths[1])
13-
- var servicesDropdown = items.children.filter(x => semverService.test(x.id))
14-
- dropdown = servicesDropdown
13+
- var versioned = items.children.reduce((acc, x) => acc + semverService.test(x.id), false)
1514
- service = hierarchy.findByPath('/' + paths[0] + '/' + paths[1])
16-
if paths[2] && semverService.test(paths[2])
15+
if versioned
1716
- versionTitle = paths[2]
18-
- items = hierarchy.findByPath('/' + paths[0] + '/' + paths[1] + '/' + paths[2])
17+
if !semverService.test(paths[2])
18+
- versionTitle = navigationTitle || title
19+
- dropdown = service.children
20+
- tmpItems = hierarchy.findByPath('/' + paths[0] + '/' + paths[1] + '/' + paths[2])
21+
if tmpItems
22+
- items = tmpItems
1923

2024
// DC/OS Docs
2125
if semver.test(paths[0])
@@ -34,7 +38,7 @@ mixin renderSidebarHeader()
3438
each val, index in dropdown
3539
if val.navigationTitle || val.title
3640
li(class='sidebar__dropdown__item')
37-
a(href=val.path, class='sidebar__dropdown__link')!= val.navigationTitle
41+
a(href=val.path, class='sidebar__dropdown__link')!= val.navigationTitle || val.title
3842
div(class='sidebar__dropdown__toggle')
3943
p(class='sidebar__dropdown__text')
4044
span(class='sidebar__dropdown__text__title')!= (service) ? service.title : 'Mesosphere DC/OS'

scss/components/_sidebar.scss

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
padding: 0;
2626
margin: 0;
2727
display: inline;
28+
overflow: hidden;
2829
&__title {
2930
color: $color-light;
3031
opacity: 0.6;

0 commit comments

Comments
 (0)