-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Inject cMenuModalBar in .mod-vertical.mod-root instead of body child. #3
Comments
Thank you! The main issue I see with this is that when you have multiple notes open, the menubar will remain within the view of the initial note, (which makes it hard to navigate). I'll have to consult with a friend of mine (he's a much more experienced developer than I am 😅). But thank you for the tip!! |
Oh, sorry i didn't even thought of testing it with multiple notes open. PoC First, we inject the bar in the Then, we change Create a new variable in #cMenuModalBar Tadam ! Video example New #cMenuModalBar
Old #cMenuModalBbar
|
I think this can work quite well. I do think the fixed height and width will be an issue for further updates, as I add more to the menu. What I will do is have the width found dynamically in JavaScript. That way, the width and height won't be hard coded (and will allow more flexibility for me to add to it). But thank you for the tip! |
Version 0.2.0 of cMenu is now able to append to workspace with no need for fixed height or width. The width is found within the generation of the menu, stored in a variable, and the left property is set. And with a few CSS adjustments to the child elements, fixed height is unneeded. Thank you for your input! cMenu.v0.2.0.mp4 |
Cool ! Like so
Thanks to this post DOM Structure would then look like that : Where |
Oh wow, nice catch! Could you explain a bit more about the resize handle issue?? Everything seems to work fine on my end but perhaps I'm missing something. |
7U78cUrFvo.mp4Yeah this is quite subtle, look at the bar on the right that disappear when i disable the plugin, it's a resizing handle that's not supposed to be there. And when i re-enable the plugin (and then click on a pan to init the plugin), you can the at the moment the bar appear, the resizing handle on the right too. You can actually even grab it and try to resize the main note but only when in fullscreen (at least for me, with my theme i can't grab it if i'm not in fullscreen). - In the video it actually resize the obsidian frame since i'm not in full screen - |
Very interesting. My hesitation was definitely warranted. I'll add a new update now, thank you very much for your insights! |
How strange. Is this what you are talking about? I wouldn't have caught this at all! You have a very good eye! It's not an awful bug but I'll add the fix in just a bit. Thanks again! Obsidian.-.Forest.-.Obsidian.v0.12.12-4.mp4 |
Yes exactly that ! I saw the bug when enabling / disabling the plugin when I was trying to do some test with the code to get the bar to show directly when the plugin is enabled (instead of waiting to click on a pan), that's when I stumbled upon the weird offset. |
It was brought to my attention that cMenu doesn't play too nicely with plugins like Sliding Panes. This is why I was hesitant to do the FR. I'll have to look into this one. Obsidian.-.Forest.-.Obsidian.v0.12.13.1.mp4 |
Yea, I kinda expected there'll be breakage too. |
Well, unfortunately I failed to make it work correctly at all. |
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 |
Love the idea. If we can make toggle-able settings i'll post my draft anyway, at least my work may not have been totally useless. We need to set a fixed height & width to
Now we have done this, we can see the bar "works" correctly, but theres an issue : Since All we have to do is then to target the 'first' note, which is the 3rd elem. inside Also we can remove
After that there's still one pixel border on the left first note that's added (you can check by adding / removing the menumodal bar) but I couldn't find which CSS rules to negate as I did with |
Hi, 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.
The text was updated successfully, but these errors were encountered: