Skip to content

NOW MANAGED ON CODEBERG

MD Editor: Last tests/check over plaintext use/switching

Dan Brown53f32849a9fc
diff --git a/resources/js/markdown/index.mts b/resources/js/markdown/index.mts
index 7538c1972..0a6e974b7 100644
--- a/resources/js/markdown/index.mts
+++ b/resources/js/markdown/index.mts
@@ -62,7 +62,6 @@ export async function init(config: MarkdownEditorConfig): Promise<MarkdownEditor
editor.input.teardown();
editor.input = newInput;
});
- window.devinput = editor.input;
listenToCommonEvents(editor);
diff --git a/resources/js/services/util.ts b/resources/js/services/util.ts
index 61a02a3d2..74ae1a935 100644
--- a/resources/js/services/util.ts
+++ b/resources/js/services/util.ts
@@ -5,7 +5,7 @@
* leading edge, instead of the trailing.
* @attribution https://davidwalsh.name/javascript-debounce-function
*/
-export function debounce(func: Function, waitMs: number, immediate: boolean): Function {
+export function debounce<T extends (...args: any[]) => any>(func: T, waitMs: number, immediate: boolean): T {
let timeout: number|null = null;
return function debouncedWrapper(this: any, ...args: any[]) {
const context: any = this;
@@ -19,7 +19,7 @@ export function debounce(func: Function, waitMs: number, immediate: boolean): Fu
}
timeout = window.setTimeout(later, waitMs);
if (callNow) func.apply(context, args);
- };
+ } as T;
}
function isDetailsElement(element: HTMLElement): element is HTMLDetailsElement {