Skip to content
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

Improve positioning doc in split screens #12694

Closed
TCOTC opened this issue Oct 3, 2024 · 0 comments
Closed

Improve positioning doc in split screens #12694

TCOTC opened this issue Oct 3, 2024 · 0 comments
Assignees
Milestone

Comments

@TCOTC
Copy link
Contributor

TCOTC commented Oct 3, 2024

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

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

} 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 排序得到最后聚焦的文档。

Vanessa219 added a commit that referenced this issue Nov 17, 2024
@Vanessa219 Vanessa219 changed the title 定位打开的文档 时,如果焦点不在编辑器,则定位最后聚焦的文档 改进存在多个分屏时 定位打开的文档 功能 Nov 17, 2024
@Vanessa219 Vanessa219 added this to the 3.1.12 milestone Nov 17, 2024
@88250 88250 changed the title 改进存在多个分屏时 定位打开的文档 功能 Improve positioning doc in split screens Nov 17, 2024
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