[FR] Inject cMenuModalBar in .mod-vertical.mod-root instead of body child.
See original GitHub issueHi, I just discovered the plugin and love the idea,
I noticed the plugin’s bar doesn’t self adjust to side panels (open/closed and their size)
I tried on my side to change (https://github.com/chetachiezikeuzor/cMenu-Plugin/blob/master/main.ts#L73)
document.body.appendChild(cMenuModalBar);
to
document.body.querySelector(".mod-root .view-content").appendChild(cMenuModalBar);
and it work like a charm (for me, at least), the bar will always stay centered in the .view-content, where the “writing content” actually is.
PS : I’m not sure about Obsidian’s rules as to what are bests practices so maybe what I propose isn’t recommended at all.
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
christophersw/Food-Systems-Strategies - Change ... - The Nest
The most flexible form of aid for local food access providers is direct financial grants. This form of funding allows food access providers...
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
Lol, no reason to feel bummed! I’m literally a beginner developer so my knowledge is super limited. I think the best option for now would be to have a toggle-able setting “Append to Body/Append to Workspace.” That way, Sliding Panes users can just toggle to fit their needs
Cool ! It seems injecting the bar as last element in
.mod-vertical.mod-root
create a resizing handle on the right, even when there’s only one note open. The workaround I found for now is to instead inject the bar directly at the top of.mod-vertical.mod-root
withinsertAdjacentElement()
instead ofappendChild()
Like so
Thanks to this post
DOM Structure would then look like that :
Where
#cMenuModalBar
div will always be above first<hr class="workspace-leaf-resize-handle">
and first<div class="workspace-leaf [...]">
instead of being last element (at least at the moment it’s injected injected in the DOM).