diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bg/js/settings/anki.js | 21 | ||||
-rw-r--r-- | ext/mixed/js/display.js | 3 |
2 files changed, 17 insertions, 7 deletions
diff --git a/ext/bg/js/settings/anki.js b/ext/bg/js/settings/anki.js index 3b0912d4..f55989fc 100644 --- a/ext/bg/js/settings/anki.js +++ b/ext/bg/js/settings/anki.js @@ -33,20 +33,27 @@ function _ankiSpinnerShow(show) { function _ankiSetError(error) { const node = document.querySelector('#anki-error'); - if (!node) { return; } + const node2 = document.querySelector('#anki-invalid-response-error'); if (error) { const errorString = `${error}`; - node.hidden = false; - node.textContent = errorString; - _ankiSetErrorData(node, error); + if (node !== null) { + node.hidden = false; + node.textContent = errorString; + _ankiSetErrorData(node, error); + } - const node2 = document.querySelector('#anki-invalid-response-error'); if (node2 !== null) { node2.hidden = (errorString.indexOf('Invalid response') < 0); } } else { - node.hidden = true; - node.textContent = ''; + if (node !== null) { + node.hidden = true; + node.textContent = ''; + } + + if (node2 !== null) { + node2.hidden = true; + } } } diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 54cda0eb..a6cfe848 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -221,13 +221,16 @@ class Display { } onHistoryWheel(e) { + if (e.altKey) { return; } const delta = -e.deltaX || e.deltaY; if (delta > 0) { this.sourceTermView(); e.preventDefault(); + e.stopPropagation(); } else if (delta < 0) { this.nextTermView(); e.preventDefault(); + e.stopPropagation(); } } |