Skip to content

Commit e35b78d

Browse files
authored
Merge pull request #1176 from drgrice1/mathquill-text-button-fix
Fix the text button on the mqeditor toolbutton.
2 parents 2b49c01 + aa53648 commit e35b78d

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

htdocs/js/MathQuill/mqeditor.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@
6262
cfgOptions.handlers = {
6363
// Disable the toolbar when a text block is entered.
6464
textBlockEnter: () => {
65-
if (answerQuill.toolbar)
66-
answerQuill.toolbar.querySelectorAll('button').forEach((button) => (button.disabled = true));
65+
answerQuill.toolbar?.querySelectorAll('button').forEach((button) => (button.disabled = true));
6766
},
6867
// Re-enable the toolbar when a text block is exited.
6968
textBlockExit: () => {
70-
if (answerQuill.toolbar)
71-
answerQuill.toolbar.querySelectorAll('button').forEach((button) => (button.disabled = false));
69+
answerQuill.toolbar?.querySelectorAll('button').forEach((button) => (button.disabled = false));
7270
}
7371
};
7472

@@ -394,8 +392,8 @@
394392
answerQuill.toolbar.tooltips.push(new bootstrap.Tooltip(button, { placement: 'left' }));
395393

396394
button.addEventListener('click', () => {
397-
answerQuill.mathField.cmd(button.dataset.latex);
398395
answerQuill.textarea.focus();
396+
answerQuill.mathField.cmd(button.dataset.latex);
399397
});
400398
}
401399

@@ -423,7 +421,6 @@
423421
answerQuill.toolbar.addEventListener('keydown', (e) => {
424422
if (e.key === 'Escape') {
425423
const nextFocusable = getNextFocusableElement(answerQuill.toolbar.lastElementChild);
426-
console.log(nextFocusable);
427424
toolbarRemove();
428425
nextFocusable?.focus();
429426
}

htdocs/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

htdocs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"prettier-check": "prettier --ignore-path=../.gitignore --check \"**/*.{js,css,scss,html}\" \"../**/*.dist.yml\""
1414
},
1515
"dependencies": {
16-
"@openwebwork/mathquill": "^0.11.0-beta.2",
16+
"@openwebwork/mathquill": "^0.11.0-beta.3",
1717
"jsxgraph": "^1.9.2",
1818
"jszip": "^3.10.1",
1919
"jszip-utils": "^0.1.0",

0 commit comments

Comments
 (0)