🎨
This commit is contained in:
parent
0239b88c43
commit
e9bddf9224
1 changed files with 7 additions and 4 deletions
|
@ -1,14 +1,17 @@
|
|||
import {hideElements} from "../ui/hideElements";
|
||||
import {isSupportCSSHL} from "../render/searchMarkRender";
|
||||
|
||||
export const destroy = (protyle: IProtyle) => {
|
||||
if (!protyle) {
|
||||
return;
|
||||
}
|
||||
hideElements(["util"], protyle);
|
||||
protyle.highlight.markHL.clear();
|
||||
protyle.highlight.mark.clear();
|
||||
protyle.highlight.ranges = [];
|
||||
protyle.highlight.rangeIndex = 0;
|
||||
if (isSupportCSSHL()) {
|
||||
protyle.highlight.markHL.clear();
|
||||
protyle.highlight.mark.clear();
|
||||
protyle.highlight.ranges = [];
|
||||
protyle.highlight.rangeIndex = 0;
|
||||
}
|
||||
protyle.observer?.disconnect();
|
||||
protyle.observerLoad?.disconnect();
|
||||
protyle.element.classList.remove("protyle");
|
||||
|
|
Loading…
Add table
Reference in a new issue