aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings/persistent-storage-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages/settings/persistent-storage-controller.js')
-rw-r--r--ext/js/pages/settings/persistent-storage-controller.js15
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();
}
/**