Skip to content

Calculate breadcrumb height dynamically #8674

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

Closed
OpaqueGlass opened this issue Jul 4, 2023 · 2 comments
Closed

Calculate breadcrumb height dynamically #8674

OpaqueGlass opened this issue Jul 4, 2023 · 2 comments
Assignees
Milestone

Comments

@OpaqueGlass
Copy link
Contributor

In what scenarios do you need this feature?

在文档面包屑插件中,在块面包屑之上插入了文档面包屑,这导致编辑区域距离窗口顶部距离增大;这时点击大纲跳转,将会导致跳转到的标题文字被遮挡(似乎还是个概率问题,不太明白原因);

跳转?

Describe the optimal solution

是否可以在大纲跳转时检查编辑区上方的实际高度再进行跳转?(考虑到面包屑等位置可能的高度变化)
如果已经考虑了,可以的话麻烦指路一下实现代码具体在哪儿(我没找到@_@);

或者麻烦给一些修改插件的建议。谢谢。

Describe the candidate solution

No response

Other information

No response

@Vanessa219
Copy link
Member

这里是写死的,你插入的 Dom 及其位置是什么样的?我这里重新计算一下吧。

@OpaqueGlass
Copy link
Contributor Author

感谢!
我这里就是直接插入在原有的面包屑(class: protyle-breadcrumb)元素的前面;
位置说明

<div class="og-fake-doc-breadcrumb-container protyle-breadcrumb"><div class="protyle-breadcrumb__bar protyle-breadcrumb__bar--nowrap"><span class="og-fake-breadcrumb-arrow-span" data-type="NOTEBOOK" data-parent-id="20210821105258-irgl53w"><svg class="protyle-breadcrumb__arrow og-fake-doc-breadcrumb-arrow" data-type="NOTEBOOK" data-parent-id="20210821105258-irgl53w">
        <use xlink:href="#iconRight"></use></svg></span><span class="protyle-breadcrumb__item fake-breadcrumb-click" data-node-id="20230627221812-qpatf9d" data-type="FILE" data-node-names="%NAMES%">
        <span class="protyle-breadcrumb__text" title="0-important">0-important</span>
    </span>
    <span class="og-fake-breadcrumb-arrow-span" data-type="FILE" data-parent-id="20230627221812-qpatf9d"><svg class="protyle-breadcrumb__arrow og-fake-doc-breadcrumb-arrow" data-type="FILE" data-parent-id="20230627221812-qpatf9d">
        <use xlink:href="#iconRight"></use></svg></span><span class="protyle-breadcrumb__item fake-breadcrumb-click" data-node-id="20230703154657-c3nep7b" data-type="FILE" data-node-names="%NAMES%">
        <span class="protyle-breadcrumb__text" title="思源笔记API(2022.7) (Duplicated 2023-07-03 15:25:02) (Conflicted 2023-07-03 15:46:57)">思源笔记API(2022.7) (Duplicated 2023-07-03 15:25:02) (Conflicted 2023-07-03 15:46:57)</span>
    </span>
    <span class="og-fake-breadcrumb-arrow-span" data-type="FILE" data-parent-id="20230703154657-c3nep7b"><svg class="protyle-breadcrumb__arrow og-fake-doc-breadcrumb-arrow" data-type="FILE" data-parent-id="20230703154657-c3nep7b">
        <use xlink:href="#iconRight"></use></svg></span></div></div>

@Vanessa219 Vanessa219 self-assigned this Jul 4, 2023
@Vanessa219 Vanessa219 added this to the 2.9.5 milestone Jul 4, 2023
Vanessa219 added a commit that referenced this issue Jul 5, 2023
@Vanessa219 Vanessa219 changed the title 是否可以在大纲点击跳转时,考虑到插件导致的编辑器上方高度变化? Calculate breadcrumb height dynamically Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants