question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API to get/set the state of the sidebar

See original GitHub issue

Feature 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:closed
  • Created a year ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dzylikecodecommented, Oct 13, 2022

Maybe document.querySelector("body").classList.remove('close')?

0reactions
Koooooo-7commented, Oct 13, 2022

@dzylikecode , no prob, Dz.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found