Remember state of top-level collapse toggle widget
This commit is contained in:
parent
0e3c9bba8e
commit
55cc9a4336
1 changed files with 6 additions and 0 deletions
|
@ -1623,6 +1623,7 @@
|
||||||
function toggleAllDocs() {
|
function toggleAllDocs() {
|
||||||
var toggle = document.getElementById("toggle-all-docs");
|
var toggle = document.getElementById("toggle-all-docs");
|
||||||
if (hasClass(toggle, "will-expand")) {
|
if (hasClass(toggle, "will-expand")) {
|
||||||
|
updateLocalStorage("collapse", "false");
|
||||||
removeClass(toggle, "will-expand");
|
removeClass(toggle, "will-expand");
|
||||||
onEveryMatchingChild(toggle, "inner", function(e) {
|
onEveryMatchingChild(toggle, "inner", function(e) {
|
||||||
e.innerHTML = labelForToggleButton(false);
|
e.innerHTML = labelForToggleButton(false);
|
||||||
|
@ -1632,6 +1633,7 @@
|
||||||
collapseDocs(e, "show");
|
collapseDocs(e, "show");
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
updateLocalStorage("collapse", "true");
|
||||||
addClass(toggle, "will-expand");
|
addClass(toggle, "will-expand");
|
||||||
onEveryMatchingChild(toggle, "inner", function(e) {
|
onEveryMatchingChild(toggle, "inner", function(e) {
|
||||||
e.innerHTML = labelForToggleButton(true);
|
e.innerHTML = labelForToggleButton(true);
|
||||||
|
@ -1972,6 +1974,10 @@
|
||||||
window.onresize = function() {
|
window.onresize = function() {
|
||||||
hideSidebar();
|
hideSidebar();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (getCurrentValue("collapse") === "true") {
|
||||||
|
toggleAllDocs();
|
||||||
|
}
|
||||||
}());
|
}());
|
||||||
|
|
||||||
// Sets the focus on the search bar at the top of the page
|
// Sets the focus on the search bar at the top of the page
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue