aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/dictionary-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-13 18:43:44 -0400
committerGitHub <noreply@github.com>2020-09-13 18:43:44 -0400
commit5ec5d0c91c0726ed74b0cb8772d992ae478625b8 (patch)
tree65c5c17c0b8c8cea2def98a79801568ea55fd12d /ext/bg/js/settings/dictionary-controller.js
parent8b033a1650ff9425963c164aba1a744aada93f20 (diff)
Database change event (#826)
* Add api.triggerDatabaseUpdated and yomichan.on('databaseUpdated') * Update databaseUpdated event usage
Diffstat (limited to 'ext/bg/js/settings/dictionary-controller.js')
-rw-r--r--ext/bg/js/settings/dictionary-controller.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/bg/js/settings/dictionary-controller.js b/ext/bg/js/settings/dictionary-controller.js
index 9292d2c4..eccb0e88 100644
--- a/ext/bg/js/settings/dictionary-controller.js
+++ b/ext/bg/js/settings/dictionary-controller.js
@@ -307,8 +307,6 @@ class SettingsDictionaryEntryUI {
prevention.end();
this.isDeleting = false;
progress.hidden = true;
-
- this.parent.trigger('databaseUpdated');
}
}
@@ -397,13 +395,13 @@ class DictionaryController {
);
this._dictionaryUI.save = () => this._settingsController.save();
this._dictionaryUI.preventPageExit = this._preventPageExit.bind(this);
- this._dictionaryUI.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
document.querySelector('#dict-main').addEventListener('change', this._onDictionaryMainChanged.bind(this), false);
document.querySelector('#database-enable-prefix-wildcard-searches').addEventListener('change', this._onDatabaseEnablePrefixWildcardSearchesChanged.bind(this), false);
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
- this._settingsController.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
+
+ yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
await this._onOptionsChanged();
await this._onDatabaseUpdated();