Rename search-frontend.js to search-main.js

Also move DisplaySearch creation into the main() function.
This commit is contained in:
toasted-nutbread 2020-04-19 14:28:07 -04:00
parent 3edaf319da
commit 4d3d5d9ccb
3 changed files with 6 additions and 9 deletions

View File

@ -16,6 +16,7 @@
*/
/* global
* DisplaySearch
* apiOptionsGet
*/
@ -54,6 +55,9 @@ function injectSearchFrontend() {
async function main() {
await yomichan.prepare();
const displaySearch = new DisplaySearch();
await displaySearch.prepare();
let optionsApplied = false;
const applyOptions = async () => {

View File

@ -72,12 +72,6 @@ class DisplaySearch extends Display {
]);
}
static create() {
const instance = new DisplaySearch();
instance.prepare();
return instance;
}
async prepare() {
try {
await super.prepare();
@ -376,5 +370,3 @@ class DisplaySearch extends Display {
}
}
}
DisplaySearch.instance = DisplaySearch.create();

View File

@ -94,6 +94,7 @@
<script src="/bg/js/search-query-parser.js"></script>
<script src="/bg/js/clipboard-monitor.js"></script>
<script src="/bg/js/search.js"></script>
<script src="/bg/js/search-frontend.js"></script>
<script src="/bg/js/search-main.js"></script>
</body>
</html>