From c387898902cf24e017e18f9e3bb140df5d791bb7 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 14 Nov 2020 21:47:43 -0500 Subject: Display fixes (#1033) * Fix an entry not always being focused * Fix typo * Fix copy action not working on Firefox --- ext/mixed/js/display.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'ext/mixed/js/display.js') 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; } -- cgit v1.2.3