David_Dumonde
New Member

Autohide course navigation menu?

On some course page I would like to be able to autohide the course navigation menu. I would like the page to open with the nav menu hidden and the space it normally fills to disappear, allowing the main content area to expand all the way to the Global Nav menu on the left. The global nav still appears but the course nav menu disappears. I'm hoping it might be possible with a dash of css or javascript. Any ideas?

Labels (1)
0 Kudos
1 Reply
bbennett2
Community Champion

Canvas will remember if the course menu is expanded or not in between sessions. If you close it, leave the course, and then go back in, it will still be closed.

Canvas keeps a number of settings in localStorage, so you could go through there to see if you can find a value. If you watch the network tab when you click on the three-bar menu, it does fire off a request to the user settings endpoint for that course, so there's as a piece of data there which loads the correct state. You shouldn't need any custom scripting to make this work.