API to get/set the state of the sidebar
See original GitHub issueFeature request
the API to get/set the state of the sidebar
What problem does this feature solve?
I am developing a VSCode extension: Docsify Preview. I want the window to keep the state of the sidebar when reloading the window.
What does the proposed API look like?
window.onbeforeunload = function (e) {
localStorage.setItem("sidebarState", $docsify.sidebar.state); // get the state of the sidebar
};
hook.ready(function () {
let sidebarState = localStorage.getItem("sidebarState");
$docsify.sidebar.state = sidebarState; // set the state of the sidebar
});
}, window.$docsify.plugins);
Issue Analytics
- State:
- Created a year ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Introduce sidebar content get/set functions #3773 - GitHub
Introduce sidebar content get/set functions #3773. Open. AntonKhorev wants to merge 1 commit into ... from AntonKhorev:changeset-list-state--sidebar. Open ...
Read more >JavaScript Sidebar API control - Syncfusion
Shows or hides the Sidebar based on the current state. Returns void. Inject. Dynamically injects the required modules to the component. Parameter, Type ......
Read more >Window.sessionStorage - Web APIs - MDN Web Docs
The read-only sessionStorage property accesses a session Storage object for the current origin. sessionStorage is similar to localStorage; ...
Read more >Walkthrough: How to Build a Custom Sidebar Extension with ...
This extension fetches data on any soccer player from a public sports API and visualizes it in the sidebar. Walkthrough: How to Build...
Read more >WizardDesigner.DisplaySideBar Property (System.Web.UI.Design ...
DisplaySideBar Property. Reference ... protected bool DisplaySideBar { get; set; } member this. ... true to display the sidebar; otherwise, false .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe
document.querySelector("body").classList.remove('close')
?@dzylikecode , no prob, Dz.