Skip to content

Commit

Permalink
TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
drgrice1 committed Nov 7, 2024
1 parent 8e645a0 commit d7ac926
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions htdocs/js/MathQuill/mqeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
if (answerQuill.latexInput.dataset.mqOpts)
Object.assign(cfgOptions, JSON.parse(answerQuill.latexInput.dataset.mqOpts));

// The handlers and preventBlur options are set after the option merge to prevent them from being overridden.
// The handlers and useIndicatorBlur options are set after
// the option merge to prevent them from being overridden.
cfgOptions.handlers = {
// Disable the toolbar when a text block is entered.
textBlockEnter: () => {
Expand All @@ -76,7 +77,7 @@
}
};

cfgOptions.preventBlur = (e) => {
cfgOptions.useIndicatorBlur = (e) => {
if (
toolbarEnabled &&
answerQuill.toolbar &&
Expand Down Expand Up @@ -353,6 +354,7 @@

answerQuill.toolbar.addEventListener('focusout', (e) => {
if (
!document.hasFocus() ||
(e.relatedTarget &&
(e.relatedTarget.closest('.quill-toolbar') ||
e.relatedTarget.classList.contains('symbol-button') ||
Expand Down Expand Up @@ -549,10 +551,11 @@

answerQuill.textarea.addEventListener('focusout', (e) => {
if (
e.relatedTarget &&
(e.relatedTarget.closest('.quill-toolbar') ||
e.relatedTarget.classList.contains('symbol-button') ||
(answerQuill.clearButton && e.relatedTarget === answerQuill.clearButton))
!document.hasFocus() ||
(e.relatedTarget &&
(e.relatedTarget.closest('.quill-toolbar') ||
e.relatedTarget.classList.contains('symbol-button') ||
(answerQuill.clearButton && e.relatedTarget === answerQuill.clearButton)))
)
return;

Expand Down

0 comments on commit d7ac926

Please sign in to comment.