Skip to content

Improve positioning doc in split screens #12694

Closed
@TCOTC

Description

@TCOTC
Contributor

改进存在多个分屏时 定位打开的文档 功能

目前是定位最左侧的文档:

} else if (type === "focus") {
const element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") ||
document.querySelector("ul.layout-tab-bar > .item--focus");
if (element) {
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;
if (tab && tab.model instanceof Editor) {
this.selectItem(tab.model.editor.protyle.notebookId, tab.model.editor.protyle.path);
}
}
event.preventDefault();
break;

多点一下就会定位到最左侧的文档:

p.s. “多点一下”的场景是使用 [js] 右键文档树定位按钮时先折叠再定位 - 链滴 里面的代码片段,有时候会先点左键再点右键(即定位文档两次)

default.webm

应该改为获取所有的页签元素然后按 data-activetime 排序得到最后聚焦的文档。

Activity

added a commit that references this issue on Nov 17, 2024
changed the title [-]`定位打开的文档` 时,如果焦点不在编辑器,则定位最后聚焦的文档[/-] [+]改进存在多个分屏时 `定位打开的文档` 功能[/+] on Nov 17, 2024
added this to the 3.1.12 milestone on Nov 17, 2024
changed the title [-]改进存在多个分屏时 `定位打开的文档` 功能[/-] [+]Improve positioning doc in split screens[/+] on Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @Vanessa219@TCOTC

      Issue actions

        Improve positioning doc in split screens · Issue #12694 · siyuan-note/siyuan