diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2020-03-04 05:30:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-04 05:30:48 +0200 |
commit | 6e47b4e241594d68384f62b1faa34c86f85addbf (patch) | |
tree | d70452c259d1aeff36c7a9485cca137b64c58405 /ext/bg/js/settings | |
parent | 46fee07d36b3966af9bacca8c6253b044bde07ee (diff) | |
parent | de8d9e6bf12f693d6579a2fb965fd7597a04288c (diff) |
Merge pull request #386 from siikamiika/simplify-backend-prepare
Simplify backend prepare
Diffstat (limited to 'ext/bg/js/settings')
-rw-r--r-- | ext/bg/js/settings/backup.js | 6 | ||||
-rw-r--r-- | ext/bg/js/settings/main.js | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/ext/bg/js/settings/backup.js b/ext/bg/js/settings/backup.js index e945d186..daa08c61 100644 --- a/ext/bg/js/settings/backup.js +++ b/ext/bg/js/settings/backup.js @@ -120,7 +120,7 @@ async function _onSettingsExportClick() { // Importing async function _settingsImportSetOptionsFull(optionsFull) { - return utilIsolate(await utilBackend().setFullOptions( + return utilIsolate(utilBackend().setFullOptions( utilBackgroundIsolate(optionsFull) )); } @@ -362,10 +362,10 @@ async function _onSettingsResetConfirmClick() { // Setup -window.addEventListener('DOMContentLoaded', () => { +function backupInitialize() { document.querySelector('#settings-export').addEventListener('click', _onSettingsExportClick, false); document.querySelector('#settings-import').addEventListener('click', _onSettingsImportClick, false); document.querySelector('#settings-import-file').addEventListener('change', _onSettingsImportFileChange, false); document.querySelector('#settings-reset').addEventListener('click', _onSettingsResetClick, false); document.querySelector('#settings-reset-modal-confirm').addEventListener('click', _onSettingsResetConfirmClick, false); -}, false); +} diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js index 127a6d2b..1bf1444c 100644 --- a/ext/bg/js/settings/main.js +++ b/ext/bg/js/settings/main.js @@ -21,7 +21,7 @@ utilBackend, utilIsolate, utilBackgroundIsolate ankiErrorShown, ankiFieldsToDict ankiTemplatesUpdateValue, onAnkiOptionsChanged, onDictionaryOptionsChanged appearanceInitialize, audioSettingsInitialize, profileOptionsSetup, dictSettingsInitialize -ankiInitialize, ankiTemplatesInitialize, storageInfoInitialize +ankiInitialize, ankiTemplatesInitialize, storageInfoInitialize, backupInitialize */ function getOptionsMutable(optionsContext) { @@ -262,6 +262,8 @@ function showExtensionInformation() { async function onReady() { + await yomichan.prepare(); + showExtensionInformation(); formSetupEventListeners(); @@ -271,6 +273,7 @@ async function onReady() { await dictSettingsInitialize(); ankiInitialize(); ankiTemplatesInitialize(); + backupInitialize(); storageInfoInitialize(); |