MCPcopy
hub / github.com/Worklenz/worklenz / remove$1

Function remove$1

worklenz-backend/src/public/tinymce/tinymce.js:19186–19210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19184 }
19185 };
19186 const remove$1 = editor => {
19187 if (!editor.removed) {
19188 const {_selectionOverrides, editorUpload} = editor;
19189 const body = editor.getBody();
19190 const element = editor.getElement();
19191 if (body) {
19192 editor.save({ is_removing: true });
19193 }
19194 editor.removed = true;
19195 editor.unbindAllNativeEvents();
19196 if (editor.hasHiddenInput && isNonNullable(element === null || element === void 0 ? void 0 : element.nextSibling)) {
19197 DOM$8.remove(element.nextSibling);
19198 }
19199 fireRemove(editor);
19200 editor.editorManager.remove(editor);
19201 if (!editor.inline && body) {
19202 restoreOriginalStyles(editor);
19203 }
19204 fireDetach(editor);
19205 DOM$8.remove(editor.getContainer());
19206 safeDestroy(_selectionOverrides);
19207 safeDestroy(editorUpload);
19208 editor.destroy();
19209 }
19210 };
19211 const destroy = (editor, automatic) => {
19212 const {selection, dom} = editor;
19213 if (editor.destroyed) {

Callers 1

removeMethod · 0.70

Calls 12

fireRemoveFunction · 0.85
restoreOriginalStylesFunction · 0.85
fireDetachFunction · 0.85
safeDestroyFunction · 0.85
unbindAllNativeEventsMethod · 0.80
isNonNullableFunction · 0.70
removeMethod · 0.65
getBodyMethod · 0.45
getElementMethod · 0.45
saveMethod · 0.45
getContainerMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected