mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
MD Editor: Last tests/check over plaintext use/switching
This commit is contained in:
@ -62,7 +62,6 @@ export async function init(config: MarkdownEditorConfig): Promise<MarkdownEditor
|
|||||||
editor.input.teardown();
|
editor.input.teardown();
|
||||||
editor.input = newInput;
|
editor.input = newInput;
|
||||||
});
|
});
|
||||||
window.devinput = editor.input;
|
|
||||||
|
|
||||||
listenToCommonEvents(editor);
|
listenToCommonEvents(editor);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* leading edge, instead of the trailing.
|
* leading edge, instead of the trailing.
|
||||||
* @attribution https://davidwalsh.name/javascript-debounce-function
|
* @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;
|
let timeout: number|null = null;
|
||||||
return function debouncedWrapper(this: any, ...args: any[]) {
|
return function debouncedWrapper(this: any, ...args: any[]) {
|
||||||
const context: any = this;
|
const context: any = this;
|
||||||
@ -19,7 +19,7 @@ export function debounce(func: Function, waitMs: number, immediate: boolean): Fu
|
|||||||
}
|
}
|
||||||
timeout = window.setTimeout(later, waitMs);
|
timeout = window.setTimeout(later, waitMs);
|
||||||
if (callNow) func.apply(context, args);
|
if (callNow) func.apply(context, args);
|
||||||
};
|
} as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isDetailsElement(element: HTMLElement): element is HTMLDetailsElement {
|
function isDetailsElement(element: HTMLElement): element is HTMLDetailsElement {
|
||||||
|
Reference in New Issue
Block a user