aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 35e66044..6f2f0a88 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -133,17 +133,21 @@ class Popup {
return false;
}
- async showContent(elementRect, writingMode, type, details, context) {
+ async showContent(details, displayDetails) {
if (this._options === null) { throw new Error('Options not assigned'); }
- const {optionsContext, source} = context;
- if (source !== this._previousOptionsContextSource) {
+ const {source, optionsContext, elementRect, writingMode} = details;
+ if (typeof source !== 'undefined' && source !== this._previousOptionsContextSource) {
await this.setOptionsContext(optionsContext, source);
}
- await this._show(elementRect, writingMode);
- if (type === null) { return; }
- this._invokeApi('setContent', {type, details});
+ if (typeof elementRect !== 'undefined' && typeof writingMode !== 'undefined') {
+ await this._show(elementRect, writingMode);
+ }
+
+ if (displayDetails !== null) {
+ this._invokeApi('setContent', {type: displayDetails.type, details: displayDetails.details});
+ }
}
setCustomCss(css) {