diff --git a/htdocs/js/MathQuill/mqeditor.js b/htdocs/js/MathQuill/mqeditor.js index 4840784f6..d6698a1e1 100644 --- a/htdocs/js/MathQuill/mqeditor.js +++ b/htdocs/js/MathQuill/mqeditor.js @@ -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)); } }; @@ -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); }); } @@ -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(); } diff --git a/htdocs/package-lock.json b/htdocs/package-lock.json index 60724a45c..355539822 100644 --- a/htdocs/package-lock.json +++ b/htdocs/package-lock.json @@ -7,7 +7,7 @@ "name": "pg.javascript_package_manager", "license": "GPL-2.0+", "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", @@ -85,9 +85,9 @@ } }, "node_modules/@openwebwork/mathquill": { - "version": "0.11.0-beta.2", - "resolved": "https://registry.npmjs.org/@openwebwork/mathquill/-/mathquill-0.11.0-beta.2.tgz", - "integrity": "sha512-cSUpkAesOPxXfQ/fWJSkmsauhvOMnUqlpib3BQu0QpgOQuYBMIrvpnKf+DsMf7FOEXix+BYlrpcE3sVoPuihhg==", + "version": "0.11.0-beta.3", + "resolved": "https://registry.npmjs.org/@openwebwork/mathquill/-/mathquill-0.11.0-beta.3.tgz", + "integrity": "sha512-ydgzM56NJHZan+LJdnxucxLQTtg7v/JPKHuDzXGtyS3dZnwohLYbeR7+PBXTFacff7EtT2u+eQhg8OooZUOAWA==", "license": "MPL-2.0" }, "node_modules/@trysound/sax": { @@ -1748,9 +1748,9 @@ } }, "@openwebwork/mathquill": { - "version": "0.11.0-beta.2", - "resolved": "https://registry.npmjs.org/@openwebwork/mathquill/-/mathquill-0.11.0-beta.2.tgz", - "integrity": "sha512-cSUpkAesOPxXfQ/fWJSkmsauhvOMnUqlpib3BQu0QpgOQuYBMIrvpnKf+DsMf7FOEXix+BYlrpcE3sVoPuihhg==" + "version": "0.11.0-beta.3", + "resolved": "https://registry.npmjs.org/@openwebwork/mathquill/-/mathquill-0.11.0-beta.3.tgz", + "integrity": "sha512-ydgzM56NJHZan+LJdnxucxLQTtg7v/JPKHuDzXGtyS3dZnwohLYbeR7+PBXTFacff7EtT2u+eQhg8OooZUOAWA==" }, "@trysound/sax": { "version": "0.2.0", diff --git a/htdocs/package.json b/htdocs/package.json index cc5c88c82..bf3daa24d 100644 --- a/htdocs/package.json +++ b/htdocs/package.json @@ -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",