mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-08 11:48:26 -04:00
parent
7887507d26
commit
abfacaa856
@ -331,13 +331,14 @@ function createNewKiwixPopoverCointainer (win, anchor, event) {
|
|||||||
const linkHref = anchor.getAttribute('href');
|
const linkHref = anchor.getAttribute('href');
|
||||||
const currentDocument = win.document;
|
const currentDocument = win.document;
|
||||||
div.popoverisloading = true;
|
div.popoverisloading = true;
|
||||||
const screenWidth = win.innerWidth - 40;
|
|
||||||
const screenHeight = document.documentElement.clientHeight;
|
|
||||||
let zoomFactor = 'zoom' in currentDocument.documentElement.style && !isSafari() ? params.relativeFontSize / 100 : 1;
|
let zoomFactor = 'zoom' in currentDocument.documentElement.style && !isSafari() ? params.relativeFontSize / 100 : 1;
|
||||||
|
// Account for zoom when calculating available screen width
|
||||||
|
const screenWidth = (win.innerWidth - 40) / zoomFactor;
|
||||||
|
const screenHeight = document.documentElement.clientHeight;
|
||||||
let margin = 40;
|
let margin = 40;
|
||||||
let divWidth = 512;
|
// Base width scaled by zoom factor
|
||||||
if (screenWidth <= divWidth) {
|
const divWidth = Math.min(512, screenWidth);
|
||||||
divWidth = screenWidth;
|
if (screenWidth <= 512) {
|
||||||
margin = 10;
|
margin = 10;
|
||||||
}
|
}
|
||||||
// Check if we have restricted screen height
|
// Check if we have restricted screen height
|
||||||
|
Loading…
x
Reference in New Issue
Block a user