diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-07-24 17:34:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-24 17:34:53 -0400 |
commit | e493cbc998eeee5d3c368287e5c5900c4821bc9d (patch) | |
tree | 955e09e9f64116178ec98cfed736434172e0dc75 /ext/fg/js/popup-proxy.js | |
parent | 3754c920410e90fc6b98aadc9f0dbe60dfa6a14d (diff) |
Simplify Popup.showContent API to use only two details arguments (#684)
Diffstat (limited to 'ext/fg/js/popup-proxy.js')
-rw-r--r-- | ext/fg/js/popup-proxy.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/fg/js/popup-proxy.js b/ext/fg/js/popup-proxy.js index 09c184db..d910d30c 100644 --- a/ext/fg/js/popup-proxy.js +++ b/ext/fg/js/popup-proxy.js @@ -88,14 +88,17 @@ class PopupProxy extends EventDispatcher { return await this._invoke('containsPoint', {id: this._id, x, y}); } - async showContent(elementRect, writingMode, type, details, context) { - let {x, y, width, height} = elementRect; - if (this._frameOffsetForwarder !== null) { - await this._updateFrameOffset(); - [x, y] = this._applyFrameOffset(x, y); + async showContent(details, displayDetails) { + const {elementRect} = details; + if (typeof elementRect !== 'undefined') { + let {x, y, width, height} = elementRect; + if (this._frameOffsetForwarder !== null) { + await this._updateFrameOffset(); + [x, y] = this._applyFrameOffset(x, y); + } + details.elementRect = {x, y, width, height}; } - elementRect = {x, y, width, height}; - return await this._invoke('showContent', {id: this._id, elementRect, writingMode, type, details, context}); + return await this._invoke('showContent', {id: this._id, details, displayDetails}); } setCustomCss(css) { |