MCPcopy Create free account
hub / github.com/cweijan/vscode-office / removeCodeBlockChrome

Function removeCodeBlockChrome

vditor/src/ts/codeBlock/codeBlockChrome.ts:761–775  ·  view source on GitHub ↗
(target: HTMLElement)

Source from the content-addressed store, hash-verified

759 updateCodeBlockChromeLanguage(blockElement, languageName);
760 recomputeExpandState(chrome, host);
761};
762
763export const removeCodeBlockChrome = (target: HTMLElement) => {
764 const chrome = chromeMap.get(target);
765 if (!chrome) {
766 return;
767 }
768 if (openLangChrome === chrome) {
769 closeLangPanel();
770 }
771 if (openThemeChrome === chrome) {
772 closeThemePanel();
773 }
774 chrome.resizeObserver?.disconnect();
775 chrome.root.remove();
776 chromeMap.delete(target);
777};
778

Callers 6

destroyCodeMirrorFunction · 0.90
exitSpecialBlockEditFunction · 0.90
removeCmCodeBlockFunction · 0.90
cleanupStaleCmArtifactsFunction · 0.90

Calls 5

closeLangPanelFunction · 0.85
closeThemePanelFunction · 0.70
getMethod · 0.65
removeMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected