summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-12-08 20:31:02 -0500
committerGitHub <noreply@github.com>2020-12-08 20:31:02 -0500
commit125c296eedf680ad7670544aa8f74d81fa9aa799 (patch)
treef91c4243fd08cad8258ec136228264d332569ab3 /ext/fg/js/popup.js
parent2be81cbb77f8a15f9049048078d69d5fee871f33 (diff)
Support frame resize on firefox (#1088)
* Add popup functions for getting/setting the frame size * Add frontend functions for getting/setting popup frame size * Expose display mode attribute on display HTML * Disable resizer on iframe * Add custom frame resizer handle * Add support for custom frame resizer
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index ffd72dca..c24ffb5c 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -208,6 +208,16 @@ class Popup extends EventDispatcher {
return this._frame.getBoundingClientRect();
}
+ async getFrameSize() {
+ const rect = this._frame.getBoundingClientRect();
+ return {width: rect.width, height: rect.height, valid: true};
+ }
+
+ async setFrameSize(width, height) {
+ this._setFrameSize(width, height);
+ return true;
+ }
+
// Private functions
_onFrameMouseOver() {
@@ -397,8 +407,7 @@ class Popup extends EventDispatcher {
frame.style.left = `${x}px`;
frame.style.top = `${y}px`;
- frame.style.width = `${width}px`;
- frame.style.height = `${height}px`;
+ this._setFrameSize(width, height);
this._setVisible(true);
if (this._child !== null) {
@@ -406,6 +415,12 @@ class Popup extends EventDispatcher {
}
}
+ _setFrameSize(width, height) {
+ const {style} = this._frame;
+ style.width = `${width}px`;
+ style.height = `${height}px`;
+ }
+
_setVisible(visible) {
this._visible.defaultValue = visible;
}