Move the right sidebar toggle to a button in the upper right icon tray.
You can add this to Roam using {{[[roam/js]]}}
Grab the code in roam-sidebar-toggle.js
and drop it in a javascript code block, nested underneath a {{[[roam/js]]}}
block:
```javascript```
Additionally, grab the code in roam-sidebar-toggle.css
and add it to a CSS code block on a Roam page titled roam/css. This will remove the standard sidebar toggle button inside the right sidebar, freeing up some crucial real estate:
```css```
hey guys! @abhayprasanna's fix seems to work for me but i also updated the js above in roam-sidebar-toggle.js to wait 1 second before trying to append the button to the topbar so it gives the page some time to load. It's definitely a bandaid fix. @orkhan10, let me know if that works. I'll keep an eye on things here in case it doesn't!
sidenote: you can try changing the value in
setTimeout(createButton, 1000);
to wait longer/shorter to create the button. 1000 = 1000ms = 1 second. so if you changed 1000 to 5000 it would wait 5 seconds after load until trying to insert the button into your DOM. I have tried using some common listener events like 'DOMContentLoaded' to insert the button but haven't had any luck, so for now, I'm just hardcoding the timeout to wait 😂