-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
refactor: refactored the positioning system of the toolbar in the "following". #150
Conversation
"following". - Refactord isExistoolbar() to get rid of deprecated code (i.e., `activeLeaf`), and to simplify the code. - Refactor the way the toolbar's position is calculated for the "following" mode, to make sure the toolbar: - Is always visible, even when we the user selects the last line in the editor. - Never overflows over the File Explorer of the Outline.
"following". - Refactord isExistoolbar() to get rid of deprecated code (i.e., `activeLeaf`), and to simplify the code. - Refactor the way the toolbar's position is calculated for the "following" mode, to make sure the toolbar: - Is always visible, even when we the user selects the last line in the editor. - Never overflows over the File Explorer of the Outline.
Thank you for your work. There seems to be a positioning issue with my computer; the toolbar keeps overflowing off the screen. We'll hold off on merging branches until it's resolved. More improvements to come. |
Can you elaborate more please, what do you mean off screen? like outside of Obsidian's window completely? and can you please make sure to disable any plugins or themes that might interfere with your testing (you could use Obsidian sandbox vault). |
"following". - Refactord isExistoolbar() to get rid of deprecated code (i.e., `activeLeaf`), and to simplify the code. - Refactor the way the toolbar's position is calculated for the "following" mode, to make sure the toolbar: - Is always visible, even when we the user selects the last line in the editor. - Never overflows over the File Explorer or the Outline.
Since getModestate() doesn't really get the mode state but rather returns whether the MarkdownView mode state is "source" or not, I renamed it to isSource(), and simplified the function in the process.
82e1f53
to
09e6246
Compare
Hi @cumany, thank you for the detailed feedback, I fixed all the issues you mentioned above in this new commit. If you need me to make any further changes feel free to tell. |
b38e265
to
e0df83d
Compare
position is set to "following". - Refactored isExistoolbar() to get rid of deprecated code (i.e., `activeLeaf`), and to simplify the code. - Refactor the way the toolbar's position is calculated for the "following" mode, to make sure the toolbar: - Is always visible, even when we the user selects the last or first line in the editor. - To try not to overflow over the File Explorer or the Outline. - Refactored getModestate() into isSource(). Since getModestate() doesn't really get the mode state but rather returns whether the MarkdownView mode state is "source" or not, I renamed it to isSource(), and simplified the function in the process.
Good job. It was perfect! |
Refactor the way the toolbar's position is calculated for the "following" mode to make sure the toolbar:
Refactord isExistoolbar() to get rid of deprecated code (i.e.,
activeLeaf
), and to simplify the code.Refactored
getModestate()
intoisSource()
: sincegetModestate()
doesn't really get the mode state, but rather returns whether the MarkdownView mode state is "source" or not, I renamed it toisSource()
to reflect just that, and simplified the function implementation in the process.