Skip to content

Commit

Permalink
Merge pull request openwebwork#1176 from drgrice1/mathquill-text-butt…
Browse files Browse the repository at this point in the history
…on-fix

Fix the text button on the mqeditor toolbutton.
  • Loading branch information
somiaj authored Jan 14, 2025
2 parents 2b49c01 + aa53648 commit e35b78d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
9 changes: 3 additions & 6 deletions htdocs/js/MathQuill/mqeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@
cfgOptions.handlers = {
// Disable the toolbar when a text block is entered.
textBlockEnter: () => {
if (answerQuill.toolbar)
answerQuill.toolbar.querySelectorAll('button').forEach((button) => (button.disabled = true));
answerQuill.toolbar?.querySelectorAll('button').forEach((button) => (button.disabled = true));
},
// Re-enable the toolbar when a text block is exited.
textBlockExit: () => {
if (answerQuill.toolbar)
answerQuill.toolbar.querySelectorAll('button').forEach((button) => (button.disabled = false));
answerQuill.toolbar?.querySelectorAll('button').forEach((button) => (button.disabled = false));
}
};

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

button.addEventListener('click', () => {
answerQuill.mathField.cmd(button.dataset.latex);
answerQuill.textarea.focus();
answerQuill.mathField.cmd(button.dataset.latex);
});
}

Expand Down Expand Up @@ -423,7 +421,6 @@
answerQuill.toolbar.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
const nextFocusable = getNextFocusableElement(answerQuill.toolbar.lastElementChild);
console.log(nextFocusable);
toolbarRemove();
nextFocusable?.focus();
}
Expand Down
14 changes: 7 additions & 7 deletions htdocs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion htdocs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"prettier-check": "prettier --ignore-path=../.gitignore --check \"**/*.{js,css,scss,html}\" \"../**/*.dist.yml\""
},
"dependencies": {
"@openwebwork/mathquill": "^0.11.0-beta.2",
"@openwebwork/mathquill": "^0.11.0-beta.3",
"jsxgraph": "^1.9.2",
"jszip": "^3.10.1",
"jszip-utils": "^0.1.0",
Expand Down

0 comments on commit e35b78d

Please sign in to comment.