summaryrefslogtreecommitdiff
path: root/ext/bg/js/search-main.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-11 22:57:38 -0500
committerGitHub <noreply@github.com>2021-02-11 22:57:38 -0500
commit1c5e3e6d397f22de99494e147cc53b106e1d16b4 (patch)
tree4e700bb6d923617146ef9fa1a4efb305bb0c5995 /ext/bg/js/search-main.js
parent94db6c69fa4aa25231e213c6d0e185197bfe3418 (diff)
Search decouple (#1369)
* Update how query post-processing is implemented * Update DisplaySearch to not subclass Display * Update display construction * Make display initialization consistent * Remove unused * Fix wanakana binding * Use own frame/tab ID * DisplaySearch => SearchDisplayController * Fix globals
Diffstat (limited to 'ext/bg/js/search-main.js')
-rw-r--r--ext/bg/js/search-main.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/bg/js/search-main.js b/ext/bg/js/search-main.js
index f6abdfc8..c7ec595a 100644
--- a/ext/bg/js/search-main.js
+++ b/ext/bg/js/search-main.js
@@ -16,10 +16,11 @@
*/
/* global
- * DisplaySearch
+ * Display
* DocumentFocusController
* HotkeyHandler
* JapaneseUtil
+ * SearchDisplayController
* api
* wanakana
*/
@@ -39,10 +40,16 @@
const hotkeyHandler = new HotkeyHandler();
hotkeyHandler.prepare();
- const displaySearch = new DisplaySearch(tabId, frameId, japaneseUtil, documentFocusController, hotkeyHandler);
- await displaySearch.prepare();
+ const display = new Display(tabId, frameId, 'search', japaneseUtil, documentFocusController, hotkeyHandler);
+ await display.prepare();
+
+ const searchDisplayController = new SearchDisplayController(tabId, frameId, display, japaneseUtil);
+ await searchDisplayController.prepare();
+
+ display.initializeState();
document.documentElement.dataset.loaded = 'true';
+
yomichan.ready();
} catch (e) {
yomichan.logError(e);