aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-12 14:55:18 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-12 15:31:29 -0400
commit6da76835524fbf6b95902f06822d77c54ccf735b (patch)
tree89b479b925e0bb48a89258710c442dac407a3fd7 /ext/fg/js/popup.js
parenta5b208fb895d46793223910451d177dc53d9463a (diff)
Don't pass options around for calls to termsShow, kanjiShow, etc.
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index a9fde7b6..f36bb436 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -41,14 +41,14 @@ class Popup {
this.updateVisibility();
}
- inject(options) {
+ inject() {
if (this.injectPromise === null) {
- this.injectPromise = this.createInjectPromise(options);
+ this.injectPromise = this.createInjectPromise();
}
return this.injectPromise;
}
- async createInjectPromise(options) {
+ async createInjectPromise() {
try {
const {frameId} = await this.frameIdPromise;
if (typeof frameId === 'number') {
@@ -62,7 +62,7 @@ class Popup {
const parentFrameId = (typeof this.frameId === 'number' ? this.frameId : null);
this.container.addEventListener('load', () => {
this.invokeApi('initialize', {
- options: options,
+ options: this.options,
popupInfo: {
id: this.id,
depth: this.depth,
@@ -87,10 +87,10 @@ class Popup {
this.options = options;
}
- async show(elementRect, writingMode, options) {
- await this.inject(options);
+ async show(elementRect, writingMode) {
+ await this.inject();
- const optionsGeneral = options.general;
+ const optionsGeneral = this.options.general;
const container = this.container;
const containerRect = container.getBoundingClientRect();
const getPosition = (
@@ -215,9 +215,9 @@ class Popup {
return [position, size, after];
}
- async showOrphaned(elementRect, writingMode, options) {
+ async showOrphaned(elementRect, writingMode) {
if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode, options);
+ await this.show(elementRect, writingMode);
this.invokeApi('orphaned');
}
@@ -279,16 +279,16 @@ class Popup {
return false;
}
- async termsShow(elementRect, writingMode, definitions, options, context) {
+ async termsShow(elementRect, writingMode, definitions, context) {
if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode, options);
- this.invokeApi('termsShow', {definitions, options, context});
+ await this.show(elementRect, writingMode);
+ this.invokeApi('termsShow', {definitions, context});
}
- async kanjiShow(elementRect, writingMode, definitions, options, context) {
+ async kanjiShow(elementRect, writingMode, definitions, context) {
if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode, options);
- this.invokeApi('kanjiShow', {definitions, options, context});
+ await this.show(elementRect, writingMode);
+ this.invokeApi('kanjiShow', {definitions, context});
}
clearAutoPlayTimer() {