Rename search-frontend.js to search-main.js
Also move DisplaySearch creation into the main() function.
This commit is contained in:
parent
3edaf319da
commit
4d3d5d9ccb
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* global
|
/* global
|
||||||
|
* DisplaySearch
|
||||||
* apiOptionsGet
|
* apiOptionsGet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -54,6 +55,9 @@ function injectSearchFrontend() {
|
|||||||
async function main() {
|
async function main() {
|
||||||
await yomichan.prepare();
|
await yomichan.prepare();
|
||||||
|
|
||||||
|
const displaySearch = new DisplaySearch();
|
||||||
|
await displaySearch.prepare();
|
||||||
|
|
||||||
let optionsApplied = false;
|
let optionsApplied = false;
|
||||||
|
|
||||||
const applyOptions = async () => {
|
const applyOptions = async () => {
|
@ -72,12 +72,6 @@ class DisplaySearch extends Display {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static create() {
|
|
||||||
const instance = new DisplaySearch();
|
|
||||||
instance.prepare();
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
async prepare() {
|
async prepare() {
|
||||||
try {
|
try {
|
||||||
await super.prepare();
|
await super.prepare();
|
||||||
@ -376,5 +370,3 @@ class DisplaySearch extends Display {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplaySearch.instance = DisplaySearch.create();
|
|
||||||
|
@ -94,6 +94,7 @@
|
|||||||
<script src="/bg/js/search-query-parser.js"></script>
|
<script src="/bg/js/search-query-parser.js"></script>
|
||||||
<script src="/bg/js/clipboard-monitor.js"></script>
|
<script src="/bg/js/clipboard-monitor.js"></script>
|
||||||
<script src="/bg/js/search.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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user