summaryrefslogtreecommitdiff
path: root/ext/fg/js/popup.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-04-18 23:39:21 +0300
committerGitHub <noreply@github.com>2020-04-18 23:39:21 +0300
commit7a03ce0194fafb0c2e49994dc6efd33d5fdb6a07 (patch)
tree68a6bc438180e9b3871cee4755a78b18ba3fa3e1 /ext/fg/js/popup.js
parent5b3d7fadc3534ba27eee971dac4ba5ee475c4e3d (diff)
parentd66ca93ce4d6a4c9814bac4cc508c24ff87b8f69 (diff)
Merge pull request #460 from siikamiika/iframe-popup-edge-cases
Iframe popup edge cases
Diffstat (limited to 'ext/fg/js/popup.js')
-rw-r--r--ext/fg/js/popup.js13
1 files changed, 2 insertions, 11 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 99610e17..ae158263 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -16,6 +16,7 @@
*/
/* global
+ * DOM
* apiGetMessageToken
* apiInjectStylesheet
*/
@@ -271,7 +272,7 @@ class Popup {
}
_onFullscreenChanged() {
- const parent = (Popup._getFullscreenElement() || document.body || null);
+ const parent = (DOM.getFullscreenElement() || document.body || null);
if (parent !== null && this._container.parentNode !== parent) {
parent.appendChild(this._container);
}
@@ -365,16 +366,6 @@ class Popup {
contentWindow.postMessage({action, params, token}, this._targetOrigin);
}
- static _getFullscreenElement() {
- return (
- document.fullscreenElement ||
- document.msFullscreenElement ||
- document.mozFullScreenElement ||
- document.webkitFullscreenElement ||
- null
- );
- }
-
static _getPositionForHorizontalText(elementRect, width, height, viewport, offsetScale, optionsGeneral) {
const preferBelow = (optionsGeneral.popupHorizontalTextPosition === 'below');
const horizontalOffset = optionsGeneral.popupHorizontalOffset * offsetScale;