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.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;
}