1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

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

This commit is contained in:
Dan Brown
2025-07-23 14:49:41 +01:00
parent 7ca8bdc231
commit 53f32849a9
2 changed files with 2 additions and 3 deletions

View File

@ -62,7 +62,6 @@ export async function init(config: MarkdownEditorConfig): Promise<MarkdownEditor
editor.input.teardown();
editor.input = newInput;
});
window.devinput = editor.input;
listenToCommonEvents(editor);

View File

@ -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 {