diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-20 10:13:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 15:13:57 +0000 |
commit | fe875bbd99980b175fc366a2bfd4395be9cbad72 (patch) | |
tree | 9eacc919cae0aa32c1a5e25b8493a0e86a21f16e /ext/js/display/display.js | |
parent | 0e4ae922451af967c78616057ed26b85ba5d4b5c (diff) |
Constructor simplification (#713)
* Update AudioDownloader
* Update Translator
* Update ClipboardMonitor
* Update ClipboardReader
* Update PanelElement
* Update QueryParser
* Update DisplayGenerator
* Update DisplayHistory
* Update DOMDataBinder
* Remove unnecessary cast
* Update Popup types
* One declaration per line
* Remove optionals from Frontend constructor
* Fix Translator constructor
Diffstat (limited to 'ext/js/display/display.js')
-rw-r--r-- | ext/js/display/display.js | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js index d0edd0bd..750e0d69 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -83,16 +83,13 @@ export class Display extends EventDispatcher { /** @type {HotkeyHelpController} */ this._hotkeyHelpController = new HotkeyHelpController(); /** @type {DisplayGenerator} */ - this._displayGenerator = new DisplayGenerator({ - contentManager: this._contentManager, - hotkeyHelpController: this._hotkeyHelpController - }); + this._displayGenerator = new DisplayGenerator(this._contentManager, this._hotkeyHelpController); /** @type {import('display').DirectApiMap} */ this._directApiMap = new Map(); /** @type {import('api-map').ApiMap<import('display').WindowApiSurface>} */ // import('display').WindowApiMap this._windowApiMap = new Map(); /** @type {DisplayHistory} */ - this._history = new DisplayHistory({clearable: true, useBrowserHistory: false}); + this._history = new DisplayHistory(true, false); /** @type {boolean} */ this._historyChangeIgnore = false; /** @type {boolean} */ @@ -126,11 +123,7 @@ export class Display extends EventDispatcher { /** @type {TextSourceGenerator} */ this._textSourceGenerator = new TextSourceGenerator(); /** @type {QueryParser} */ - this._queryParser = new QueryParser({ - api: application.api, - getSearchContext: this._getSearchContext.bind(this), - textSourceGenerator: this._textSourceGenerator - }); + this._queryParser = new QueryParser(application.api, this._textSourceGenerator, this._getSearchContext.bind(this)); /** @type {HTMLElement} */ this._contentScrollElement = querySelectorNotNull(document, '#content-scroll'); /** @type {HTMLElement} */ @@ -1712,8 +1705,7 @@ export class Display extends EventDispatcher { const popupFactory = new PopupFactory(this._application); popupFactory.prepare(); - /** @type {import('frontend').ConstructorDetails} */ - const setupNestedPopupsOptions = { + const frontend = new Frontend({ application: this._application, useProxyPopup, parentPopupId, @@ -1723,10 +1715,9 @@ export class Display extends EventDispatcher { pageType: this._pageType, allowRootFramePopupProxy: true, childrenSupported: this._childrenSupported, - hotkeyHandler: this._hotkeyHandler - }; - - const frontend = new Frontend(setupNestedPopupsOptions); + hotkeyHandler: this._hotkeyHandler, + canUseWindowPopup: true + }); this._frontend = frontend; await frontend.prepare(); } |