This commit is contained in:
Vanessa 2023-01-04 11:10:57 +08:00
parent 7690ca7c05
commit e4b9feb4f6

View file

@ -363,18 +363,20 @@ export class Wnd {
} }
} }
}); });
const initData = currentTab.headElement.getAttribute("data-initdata"); if (currentTab) {
if (initData) { const initData = currentTab.headElement.getAttribute("data-initdata");
const json = JSON.parse(initData); if (initData) {
currentTab.addModel(new Editor({ const json = JSON.parse(initData);
tab: currentTab, currentTab.addModel(new Editor({
blockId: json.blockId, tab: currentTab,
mode: json.mode, blockId: json.blockId,
action: typeof json.action === "string" ? [json.action] : json.action, mode: json.mode,
scrollAttr: json.scrollAttr, action: typeof json.action === "string" ? [json.action] : json.action,
})); scrollAttr: json.scrollAttr,
currentTab.headElement.removeAttribute("data-initdata"); }));
return; currentTab.headElement.removeAttribute("data-initdata");
return;
}
} }
if (currentTab && target === currentTab.headElement) { if (currentTab && target === currentTab.headElement) {