mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-79264 tiny_equation: Correct debounce method
The debounced method was being called immediately instead of being debounced.
This commit is contained in:
parent
6ceabf28d3
commit
12c67aaae1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -66,6 +66,7 @@ const displayDialogue = async(editor) => {
|
||||
currentForm = root.querySelector(Selectors.elements.form);
|
||||
|
||||
const contextId = getContextId(editor);
|
||||
const debouncedPreviewUpdater = debounce(() => updatePreview(getContextId(editor)), 500);
|
||||
|
||||
$root.on(ModalEvents.hidden, () => {
|
||||
modalPromises.destroy();
|
||||
@ -95,14 +96,14 @@ const displayDialogue = async(editor) => {
|
||||
modalPromises.destroy();
|
||||
}
|
||||
if (textArea) {
|
||||
debounce(updatePreview(contextId), 500);
|
||||
debouncedPreviewUpdater();
|
||||
}
|
||||
});
|
||||
|
||||
root.addEventListener('keyup', (e) => {
|
||||
const textArea = e.target.closest(Selectors.elements.equationTextArea);
|
||||
if (textArea) {
|
||||
debounce(updatePreview(contextId), 500);
|
||||
debouncedPreviewUpdater();
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user