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 (initData) {
const json = JSON.parse(initData);
currentTab.addModel(new Editor({
tab: currentTab,
blockId: json.blockId,
mode: json.mode,
action: typeof json.action === "string" ? [json.action] : json.action,
scrollAttr: json.scrollAttr,
}));
currentTab.headElement.removeAttribute("data-initdata");
return;
if (currentTab) {
const initData = currentTab.headElement.getAttribute("data-initdata");
if (initData) {
const json = JSON.parse(initData);
currentTab.addModel(new Editor({
tab: currentTab,
blockId: json.blockId,
mode: json.mode,
action: typeof json.action === "string" ? [json.action] : json.action,
scrollAttr: json.scrollAttr,
}));
currentTab.headElement.removeAttribute("data-initdata");
return;
}
}
if (currentTab && target === currentTab.headElement) {