mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-13 20:28:50 +01:00
20 lines
485 B
TypeScript
20 lines
485 B
TypeScript
export const destroy = (protyle: IProtyle) => {
|
|
if (!protyle) {
|
|
return;
|
|
}
|
|
protyle.element.classList.remove("protyle");
|
|
protyle.element.removeAttribute("style");
|
|
if (protyle.wysiwyg) {
|
|
protyle.wysiwyg.lastHTMLs = {};
|
|
}
|
|
if (protyle.undo) {
|
|
protyle.undo.clear();
|
|
}
|
|
try {
|
|
protyle.ws.send("closews", {});
|
|
} catch (e) {
|
|
setTimeout(() => {
|
|
protyle.ws.send("closews", {});
|
|
}, 10240);
|
|
}
|
|
};
|