From 286534e648af350d24fbf3c7892a7ec81aaeb4bd Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 14 Feb 2021 15:53:35 -0500 Subject: 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 --- ext/js/settings/popup-preview-frame.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ext/js/settings/popup-preview-frame.js') diff --git a/ext/js/settings/popup-preview-frame.js b/ext/js/settings/popup-preview-frame.js index 56100fb3..638dd414 100644 --- a/ext/js/settings/popup-preview-frame.js +++ b/ext/js/settings/popup-preview-frame.js @@ -18,7 +18,6 @@ /* global * Frontend * TextSourceRange - * api * wanakana */ @@ -63,8 +62,8 @@ class PopupPreviewFrame { this._exampleTextInput.addEventListener('input', this._onExampleTextInputInput.bind(this), false); // Overwrite API functions - this._apiOptionsGetOld = api.optionsGet.bind(api); - api.optionsGet = this._apiOptionsGet.bind(this); + this._apiOptionsGetOld = yomichan.api.optionsGet.bind(yomichan.api); + yomichan.api.optionsGet = this._apiOptionsGet.bind(this); // Overwrite frontend this._frontend = new Frontend({ -- cgit v1.2.3