diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-11-14 21:47:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-14 21:47:43 -0500 |
commit | c387898902cf24e017e18f9e3bb140df5d791bb7 (patch) | |
tree | 88c5aaabd59ab168095362dc9a8da43200746efb /ext/mixed/js/display.js | |
parent | 4b1c7b1e269b98eaf4906c82cb3fd09566dce7be (diff) |
Display fixes (#1033)
* Fix an entry not always being focused
* Fix typo
* Fix copy action not working on Firefox
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r-- | ext/mixed/js/display.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index c0102379..f79ba303 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -466,7 +466,7 @@ class Display extends EventDispatcher { this._closePopups(); this._setEventListenersActive(false); - let asigned = false; + let assigned = false; const eventArgs = {type, urlSearchParams, token}; this._historyHasChanged = true; this._contentType = type; @@ -476,7 +476,7 @@ class Display extends EventDispatcher { case 'kanji': { const isTerms = (type === 'terms'); - asigned = await this._setContentTermsOrKanji(token, isTerms, urlSearchParams, eventArgs); + assigned = await this._setContentTermsOrKanji(token, isTerms, urlSearchParams, eventArgs); } break; case 'unloaded': @@ -485,14 +485,14 @@ class Display extends EventDispatcher { eventArgs.content = content; this.trigger('contentUpdating', eventArgs); this._setContentExtensionUnloaded(); - asigned = true; + assigned = true; } break; } const stale = (this._setContentToken !== token); if (!stale) { - if (!asigned) { + if (!assigned) { type = 'clear'; this._contentType = type; const {content} = this._history; @@ -910,9 +910,7 @@ class Display extends EventDispatcher { container.appendChild(entry); } - if (typeof focusEntry === 'number') { - this._focusEntry(focusEntry, false); - } + this._focusEntry(typeof focusEntry === 'number' ? focusEntry : 0, false); if (typeof scrollX === 'number' || typeof scrollY === 'number') { let {x, y} = this._windowScroll; if (typeof scrollX === 'number') { x = scrollX; } |