Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 0a45a47

Browse files
chalinkwalrath
authored andcommitted
docs(api): fix cross-language dropdown menu (#2187)
- Re-enable dropdown on main API page. - Remove Dart choice from TS & JS API entry pages dropdown.
1 parent 2fd85d1 commit 0a45a47

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

public/_includes/_hero.jade

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ header(class="hero background-sky", style=fixHeroCss ? "height:auto" : "")
3535

3636
else if current.path[3] == 'api' && current.path[1] == 'dart'
3737
block breadcrumbs
38+
//- Show cross-language menu for top-level API page (but not entry pages)
39+
if ! public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]
40+
!= partial("_version-dropdown")
3841
else if current.path[0] == "docs"
3942
!= partial("_version-dropdown")

public/_includes/_version-dropdown.jade

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- var version = ''
66
- var page = ''
77

8-
<!-- Replace _ underscores with . dots -->
8+
//- Replace _ underscores with . dots
99
if current.path[2]
1010
- var version = current.path[2].replace(/\_+/gm, ".")
1111

@@ -33,7 +33,7 @@ else if current.path[3]
3333
else
3434
- var page = current.path[3] + '.html'
3535

36-
<!-- VERSION TREE CREATOR MIXIN -->
36+
//- VERSION TREE CREATOR MIXIN
3737
mixin tree(directory, urlPrefix, name, latest)
3838
ul
3939
for val, semvar in directory
@@ -42,7 +42,7 @@ mixin tree(directory, urlPrefix, name, latest)
4242
li <a href="#{urlPrefix}/#{semvar}/#{page}" md-button>#{name} #{libVersion}</a>
4343

4444

45-
<!-- BUTTON TITLE GENERATION -->
45+
//- BUTTON TITLE GENERATION
4646
if language == 'ts'
4747
if version == "latest"
4848
- var title = 'Angular 2 for TypeScript'
@@ -72,4 +72,6 @@ nav.dropdown
7272
div(class="dropdown-menu" ng-class="appCtrl.showMenu ? 'is-visible' : ''")
7373
mixin tree(public.docs.ts, "/docs/ts", "Angular 2 for TypeScript")
7474
mixin tree(public.docs.js, "/docs/js", "Angular 2 for JavaScript")
75-
mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart")
75+
//- Disable cross-language link for API entry pages (but keep for top API search page):
76+
if ! (current.path[3] === 'api' && public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]])
77+
mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart")

0 commit comments

Comments
 (0)