summaryrefslogtreecommitdiff
path: root/ext/js/settings/settings-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-14 15:53:35 -0500
committerGitHub <noreply@github.com>2021-02-14 15:53:35 -0500
commit286534e648af350d24fbf3c7892a7ec81aaeb4bd (patch)
tree89d88e961c5a0a6f508c66789e30b9ba4a968e73 /ext/js/settings/settings-controller.js
parentefe8140f103179f50b610f182148b9427af99010 (diff)
Move api to yomichan object (#1392)
* Move cross frame API from API to Yomichan * Add API instance to Yomichan * Move api global to yomichan.api * Pass yomichan to API * Remove IIFE
Diffstat (limited to 'ext/js/settings/settings-controller.js')
-rw-r--r--ext/js/settings/settings-controller.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/ext/js/settings/settings-controller.js b/ext/js/settings/settings-controller.js
index 11a9435c..4a86470d 100644
--- a/ext/js/settings/settings-controller.js
+++ b/ext/js/settings/settings-controller.js
@@ -19,7 +19,6 @@
* HtmlTemplateCollection
* OptionsUtil
* PermissionsUtil
- * api
*/
class SettingsController extends EventDispatcher {
@@ -62,16 +61,16 @@ class SettingsController extends EventDispatcher {
async getOptions() {
const optionsContext = this.getOptionsContext();
- return await api.optionsGet(optionsContext);
+ return await yomichan.api.optionsGet(optionsContext);
}
async getOptionsFull() {
- return await api.optionsGetFull();
+ return await yomichan.api.optionsGetFull();
}
async setAllSettings(value) {
const profileIndex = value.profileCurrent;
- await api.setAllSettings(value, this._source);
+ await yomichan.api.setAllSettings(value, this._source);
this._setProfileIndex(profileIndex);
}
@@ -108,7 +107,7 @@ class SettingsController extends EventDispatcher {
}
async getDictionaryInfo() {
- return await api.getDictionaryInfo();
+ return await yomichan.api.getDictionaryInfo();
}
getOptionsContext() {
@@ -171,12 +170,12 @@ class SettingsController extends EventDispatcher {
async _getSettings(targets, extraFields) {
targets = this._setupTargets(targets, extraFields);
- return await api.getSettings(targets);
+ return await yomichan.api.getSettings(targets);
}
async _modifySettings(targets, extraFields) {
targets = this._setupTargets(targets, extraFields);
- return await api.modifySettings(targets, this._source);
+ return await yomichan.api.modifySettings(targets, this._source);
}
_onBeforeUnload(e) {