summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-16 21:36:10 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-17 18:40:43 -0400
commit598cd32946c8e10e5aa3fcec26e3fc40af44bddf (patch)
treecd030ed1d5f60aaba15c3a1c2bec284154bfc038 /ext/fg/js/popup.js
parent779b4af590b7a9030de9da1005bb3d8f79c3c5d0 (diff)
Update *show* APIs to unified showContent and setContent
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js25
1 files changed, 7 insertions, 18 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 2a9670fc..6c24c0ce 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -90,6 +90,13 @@ class Popup {
this.updateTheme();
}
+ async showContent(elementRect, writingMode, type=null, details=null) {
+ if (!this.isInitialized()) { return; }
+ await this.show(elementRect, writingMode);
+ if (type === null) { return; }
+ this.invokeApi('setContent', {type, details});
+ }
+
async show(elementRect, writingMode) {
await this.inject();
@@ -218,12 +225,6 @@ class Popup {
return [position, size, after];
}
- async showOrphaned(elementRect, writingMode) {
- if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode);
- this.invokeApi('orphaned');
- }
-
hide(changeFocus) {
if (!this.isVisible()) {
return;
@@ -320,18 +321,6 @@ class Popup {
return false;
}
- async termsShow(elementRect, writingMode, definitions, context) {
- if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode);
- this.invokeApi('termsShow', {definitions, context});
- }
-
- async kanjiShow(elementRect, writingMode, definitions, context) {
- if (!this.isInitialized()) { return; }
- await this.show(elementRect, writingMode);
- this.invokeApi('kanjiShow', {definitions, context});
- }
-
async setCustomCss(css) {
this.invokeApi('setCustomCss', {css});
}