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.
This commit is contained in:
Patrice Chalin 2016-08-24 14:48:23 -07:00 committed by Kathy Walrath
parent 2fd85d1adc
commit 0a45a47c73
2 changed files with 9 additions and 4 deletions

View File

@ -35,5 +35,8 @@ header(class="hero background-sky", style=fixHeroCss ? "height:auto" : "")
else if current.path[3] == 'api' && current.path[1] == 'dart' else if current.path[3] == 'api' && current.path[1] == 'dart'
block breadcrumbs block breadcrumbs
//- Show cross-language menu for top-level API page (but not entry pages)
if ! public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]
!= partial("_version-dropdown")
else if current.path[0] == "docs" else if current.path[0] == "docs"
!= partial("_version-dropdown") != partial("_version-dropdown")

View File

@ -5,7 +5,7 @@
- var version = '' - var version = ''
- var page = '' - var page = ''
<!-- Replace _ underscores with . dots --> //- Replace _ underscores with . dots
if current.path[2] if current.path[2]
- var version = current.path[2].replace(/\_+/gm, ".") - var version = current.path[2].replace(/\_+/gm, ".")
@ -33,7 +33,7 @@ else if current.path[3]
else else
- var page = current.path[3] + '.html' - var page = current.path[3] + '.html'
<!-- VERSION TREE CREATOR MIXIN --> //- VERSION TREE CREATOR MIXIN
mixin tree(directory, urlPrefix, name, latest) mixin tree(directory, urlPrefix, name, latest)
ul ul
for val, semvar in directory for val, semvar in directory
@ -42,7 +42,7 @@ mixin tree(directory, urlPrefix, name, latest)
li <a href="#{urlPrefix}/#{semvar}/#{page}" md-button>#{name} #{libVersion}</a> li <a href="#{urlPrefix}/#{semvar}/#{page}" md-button>#{name} #{libVersion}</a>
<!-- BUTTON TITLE GENERATION --> //- BUTTON TITLE GENERATION
if language == 'ts' if language == 'ts'
if version == "latest" if version == "latest"
- var title = 'Angular 2 for TypeScript' - var title = 'Angular 2 for TypeScript'
@ -72,4 +72,6 @@ nav.dropdown
div(class="dropdown-menu" ng-class="appCtrl.showMenu ? 'is-visible' : ''") div(class="dropdown-menu" ng-class="appCtrl.showMenu ? 'is-visible' : ''")
mixin tree(public.docs.ts, "/docs/ts", "Angular 2 for TypeScript") mixin tree(public.docs.ts, "/docs/ts", "Angular 2 for TypeScript")
mixin tree(public.docs.js, "/docs/js", "Angular 2 for JavaScript") mixin tree(public.docs.js, "/docs/js", "Angular 2 for JavaScript")
//- Disable cross-language link for API entry pages (but keep for top API search page):
if ! (current.path[3] === 'api' && public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]])
mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart") mixin tree(public.docs.dart, "/docs/dart", "Angular 2 for Dart")