This commit is contained in:
Vanessa 2023-06-19 21:04:56 +08:00
parent 887443c321
commit 39f9aaca82
11 changed files with 45 additions and 46 deletions

View file

@ -106,12 +106,12 @@ export class Outline extends Model {
click: (element: HTMLElement) => {
const id = element.getAttribute("data-node-id");
if (this.isPreview) {
const headElement = document.getElementById(id)
const headElement = document.getElementById(id);
if (headElement) {
const tabElement = hasTopClosestByClassName(headElement, "protyle")
const tabElement = hasTopClosestByClassName(headElement, "protyle");
if (tabElement) {
const tab = getInstanceById(tabElement.getAttribute("data-id")) as Tab
tab.parent.switchTab(tab.headElement)
const tab = getInstanceById(tabElement.getAttribute("data-id")) as Tab;
tab.parent.switchTab(tab.headElement);
}
headElement.scrollIntoView();
} else {
@ -337,7 +337,7 @@ export class Outline extends Model {
if (this.isPreview) {
this.tree.element.querySelectorAll(".popover__block").forEach(item => {
item.classList.remove("popover__block");
})
});
}
if (currentId) {