diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-01 10:00:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 15:00:59 +0000 |
commit | dfd42bad0b46845ad88d1fdc5fa82b4f03bab0f3 (patch) | |
tree | 04686b943b84b33b8927238be17e4bc0dda7eb62 /ext/js/pages/settings/persistent-storage-controller.js | |
parent | 2356223942a21d1683ac38eed8e7b9485f453d87 (diff) |
Application refactor (#591)
* Rename Yomitan class to Application, change initialization style
* Rename file
* Update init
* Update config
* Remove dead code
Diffstat (limited to 'ext/js/pages/settings/persistent-storage-controller.js')
-rw-r--r-- | ext/js/pages/settings/persistent-storage-controller.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/js/pages/settings/persistent-storage-controller.js b/ext/js/pages/settings/persistent-storage-controller.js index baffa969..8b7726dd 100644 --- a/ext/js/pages/settings/persistent-storage-controller.js +++ b/ext/js/pages/settings/persistent-storage-controller.js @@ -18,14 +18,23 @@ import {isObject} from '../../core/utilities.js'; import {querySelectorNotNull} from '../../dom/query-selector.js'; -import {yomitan} from '../../yomitan.js'; export class PersistentStorageController { - constructor() { + /** + * @param {import('../../application.js').Application} application + */ + constructor(application) { + /** @type {import('../../application.js').Application} */ + this._application = application; /** @type {HTMLInputElement} */ this._persistentStorageCheckbox = querySelectorNotNull(document, '#storage-persistent-checkbox'); } + /** @type {import('../../application.js').Application} */ + get application() { + return this._application; + } + /** */ async prepare() { this._persistentStorageCheckbox.addEventListener('change', this._onPersistentStorageCheckboxChange.bind(this), false); @@ -82,7 +91,7 @@ export class PersistentStorageController { const node = document.querySelector('#storage-persistent-fail-warning'); if (node !== null) { node.hidden = isStoragePeristent; } - yomitan.triggerStorageChanged(); + this._application.triggerStorageChanged(); } /** |