aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/popup-factory.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-07-24 17:34:53 -0400
committerGitHub <noreply@github.com>2020-07-24 17:34:53 -0400
commite493cbc998eeee5d3c368287e5c5900c4821bc9d (patch)
tree955e09e9f64116178ec98cfed736434172e0dc75 /ext/fg/js/popup-factory.js
parent3754c920410e90fc6b98aadc9f0dbe60dfa6a14d (diff)
Simplify Popup.showContent API to use only two details arguments (#684)
Diffstat (limited to 'ext/fg/js/popup-factory.js')
-rw-r--r--ext/fg/js/popup-factory.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/fg/js/popup-factory.js b/ext/fg/js/popup-factory.js
index c48db51a..1dc7d61e 100644
--- a/ext/fg/js/popup-factory.js
+++ b/ext/fg/js/popup-factory.js
@@ -124,11 +124,16 @@ class PopupFactory {
return await popup.containsPoint(x, y);
}
- async _onApiShowContent({id, elementRect, writingMode, type, details, context}) {
+ async _onApiShowContent({id, details, displayDetails}) {
const popup = this._getPopup(id);
- elementRect = this._convertJsonRectToDOMRect(popup, elementRect);
if (!this._popupCanShow(popup)) { return; }
- return await popup.showContent(elementRect, writingMode, type, details, context);
+
+ const {elementRect} = details;
+ if (typeof elementRect !== 'undefined') {
+ details.elementRect = this._convertJsonRectToDOMRect(popup, elementRect);
+ }
+
+ return await popup.showContent(details, displayDetails);
}
_onApiSetCustomCss({id, css}) {