fix(version-dropdown): allow deeper paths to API pages

This is a horrible hack but it works (for now).
Really this needs to be made generic to cope with any level of path.

Closes #970
This commit is contained in:
Peter Bacon Darwin 2016-03-17 08:09:34 +00:00
parent 4bc8ffaf58
commit ee5096f916
1 changed files with 13 additions and 1 deletions

View File

@ -9,7 +9,19 @@
if current.path[2] if current.path[2]
- var version = current.path[2].replace(/\_+/gm, ".") - var version = current.path[2].replace(/\_+/gm, ".")
if current.path[4] if current.path[6]
if public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]][current.path[5]][current.path[6]]
- var page = current.path[3] + '/' + current.path[4] + current.path[5] + current.path[6] + '/'
else
- var page = current.path[3] + '/' + current.path[4] + current.path[5] + current.path[6] + '.html'
else if current.path[5]
if public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]][current.path[5]]
- var page = current.path[3] + '/' + current.path[4] + current.path[5] + '/'
else
- var page = current.path[3] + '/' + current.path[4] + current.path[5] + '.html'
else if current.path[4]
if public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]] if public.docs[current.path[1]][current.path[2]][current.path[3]][current.path[4]]
- var page = current.path[3] + '/' + current.path[4] + '/' - var page = current.path[3] + '/' + current.path[4] + '/'
else else