This commit is contained in:
Vanessa 2022-10-19 18:37:33 +08:00
parent 0faf73d2c1
commit 4cd1bd68e5
4 changed files with 4 additions and 7 deletions

View file

@ -187,6 +187,7 @@ progressLoading: 400
text-align: center;
white-space: nowrap;
align-self: center;
font-size: 12px;
}
&__item {
@ -240,6 +241,7 @@ progressLoading: 400
line-height: 32px;
border-top: .5px solid var(--b3-border-color);
padding: 0 5px;
font-size: 12px;
.toolbar__item {
color: var(--b3-theme-on-surface);

View file

@ -30,7 +30,6 @@ export class Tab {
this.headElement = document.createElement("li");
this.headElement.setAttribute("data-type", "tab-header");
this.headElement.setAttribute("draggable", "true");
this.headElement.setAttribute("style", "max-width: 0");
this.headElement.setAttribute("data-id", this.id);
this.headElement.setAttribute("data-position", "center"); // showTooltip 位置标识
this.headElement.classList.add("item", "item--focus");

View file

@ -353,7 +353,6 @@ export class Wnd {
}
}
});
const initData = currentTab.headElement.getAttribute("data-initdata");
if (initData) {
const json = JSON.parse(initData);
@ -443,11 +442,6 @@ export class Wnd {
} else {
this.headersElement.children[oldFocusIndex].after(tab.headElement);
}
setTimeout(() => {
tab.headElement.removeAttribute("style");
}, Constants.TIMEOUT_TRANSITION);
tab.headElement.querySelector(".item__close").addEventListener("click", (event) => {
if (tab.headElement.classList.contains("item--pin")) {
tab.unpin();
@ -505,6 +499,7 @@ export class Wnd {
}
} else {
this.switchTab(item, true);
this.showHeading();
window.siyuan.menus.menu.remove();
}
event.preventDefault();

View file

@ -216,6 +216,7 @@ const JSONToCenter = (json: any, layout?: Layout | Wnd | Tab | Model) => {
child.headElement.setAttribute("data-init-active", "true");
}
(layout as Wnd).addTab(child);
(layout as Wnd).showHeading();
} else if (json.instance === "Editor" && json.blockId) {
(layout as Tab).headElement.setAttribute("data-initdata", JSON.stringify(json));
} else if (json.instance === "Asset") {