Update reference docs with most recent version of brodocs (#4600)

* Update 1.7 apidocs with new brodocs

* Update 1.7 resource reference docs with new brodocs

* Update 1.7 kubectl reference docs with new brodocs
This commit is contained in:
Phillip Wittrock
2017-08-04 14:30:56 -07:00
committed by Andrew Chen
parent 4b004cf717
commit 217c86642f
387 changed files with 10024 additions and 8309 deletions
+29 -2
View File
@@ -1,5 +1,9 @@
$(document).ready(function() {
/**
* TODO: Refactor with intent toward pure functions. Mutation of state can lead to bugs and difficult debugging.
*/
var toc = navData.toc;
var flatToc = navData.flatToc.reverse();
@@ -46,20 +50,35 @@ $(document).ready(function() {
prevL2Nav,
currL2Nav;
// No active section - return existing activeTokensObj (may be empty)
if (!activeSection) {
return activeTokensObj;
}
/**
* This block deals with L1Nav sections
*/
// If no previous token, set previous to current active and show L1Nav
if (!prevSectionToken) {
prevSectionToken = activeSection.token;
currL1Nav = getNavNode(activeSection.token);
currL1Nav.show('fast');
} else if (activeSection.token !== prevSectionToken) {
}
// If active active is not the same as previous, hide previous L1Nav and show current L1Nav; set previous to current
else if (activeSection.token !== prevSectionToken) {
prevL1Nav = getNavNode(prevSectionToken);
currL1Nav = getNavNode(activeSection.token);
prevL1Nav.hide('fast');
currL1Nav.show('fast');
prevSectionToken = activeSection.token;
}
/**
* This block deals with L2Nav subsections
*/
// If there is a subsections array and it has a non-zero length, set active subsection
if (activeSection.subsections && activeSection.subsections.length !== 0) {
activeSubSection = checkNodePositions(activeSection.subsections, tocFlat, scrollPosition);
if (activeSubSection) {
@@ -75,6 +94,8 @@ $(document).ready(function() {
prevSubsectionToken = activeSubSection.token;
}
} else {
prevL2Nav = getNavNode(prevSubsectionToken);
prevL2Nav.hide('fast');
prevSubsectionToken = null;
}
}
@@ -83,6 +104,10 @@ $(document).ready(function() {
return activeTokensObj;
}
/**
* Checks for active elements by scroll position
*/
var prevElemToken;
var activeElemToken;
@@ -153,7 +178,9 @@ $(document).ready(function() {
$(window).on('hashchange', function(event) {
var scrollPosition = $(window).scrollTop();
var activeSectionTokens = scrollActions(scrollPosition);
// scrollToNav(activeSectionTokens.L1);
var activeElemToken = checkActiveElement(flatToc, scrollPosition);
var scrollToken = activeSectionTokens.L2 ? activeSectionTokens.L2 : activeSectionTokens.L1;
scrollToNav(scrollToken);
var token = location.hash.slice(1);
});