summaryrefslogtreecommitdiff
path: root/ext/fg/js/float.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-23 17:12:09 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-22 20:38:21 -0500
commite740965d4f39a34eecf8a211f22eddf56d185fed (patch)
treebe3f02ded6213fb1abc5d4cdc646eeaa5a991892 /ext/fg/js/float.js
parent22afab2f47bcc1e5e9ac0db35d2f1b168becf76e (diff)
Scale popup based on current page zoom factor
Diffstat (limited to 'ext/fg/js/float.js')
-rw-r--r--ext/fg/js/float.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/fg/js/float.js b/ext/fg/js/float.js
index c550579d..8d61d8f6 100644
--- a/ext/fg/js/float.js
+++ b/ext/fg/js/float.js
@@ -89,7 +89,11 @@ class DisplayFloat extends Display {
}
}
- async initialize(options, popupInfo, url, childrenSupported) {
+ setContentScale(scale) {
+ document.body.style.fontSize = `${scale}em`;
+ }
+
+ async initialize(options, popupInfo, url, childrenSupported, scale) {
await super.initialize(options);
const {id, depth, parentFrameId} = popupInfo;
@@ -99,6 +103,8 @@ class DisplayFloat extends Display {
if (childrenSupported) {
popupNestedInitialize(id, depth, parentFrameId, url);
}
+
+ this.setContentScale(scale);
}
}
@@ -116,7 +122,8 @@ DisplayFloat._messageHandlers = new Map([
['setContent', (self, {type, details}) => self.setContent(type, details)],
['clearAutoPlayTimer', (self) => self.clearAutoPlayTimer()],
['setCustomCss', (self, {css}) => self.setCustomCss(css)],
- ['initialize', (self, {options, popupInfo, url, childrenSupported}) => self.initialize(options, popupInfo, url, childrenSupported)]
+ ['initialize', (self, {options, popupInfo, url, childrenSupported, scale}) => self.initialize(options, popupInfo, url, childrenSupported, scale)],
+ ['setContentScale', (self, {scale}) => self.setContentScale(scale)]
]);
DisplayFloat.instance = new DisplayFloat();