Skip to content

Commit

Permalink
Fix bug that meant QR code wasn't showing on mobile view if text hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
FayCross authored and torinfo committed Nov 5, 2023
1 parent 85a63f0 commit 1e09e6b
Showing 1 changed file with 6 additions and 8 deletions.
Expand Up @@ -118,14 +118,17 @@
// ** when hide text is on
var imgMaxW, imgMaxH,
imageSize = x_currentPageXML.getAttribute("imagesize");

if (x_currentPageXML.getAttribute("align") == "Hide text") {

if (x_browserInfo.mobile == true) {
imgMaxW = 250; // mobile
imgMaxH = 250;
} else if (x_currentPageXML.getAttribute("align") == "Hide text") {
imgMaxW = $x_pageDiv.width();
imgMaxH = $x_pageHolder.height() - ($x_pageDiv.outerHeight() - $x_pageDiv.height());
imgMaxW -= ($("#imgHolder .panel").outerWidth() - $("#imgHolder .panel").width());
imgMaxH -= ($("#imgHolder .panel").outerHeight() - $("#imgHolder .panel").height());

} else if (imageSize != undefined && x_browserInfo.mobile != true) {
} else if (imageSize != undefined) {
imgMaxW = $x_pageDiv.width();
imgMaxH = $x_pageHolder.height() - ($x_pageDiv.outerHeight() - $x_pageDiv.height());

Expand All @@ -143,18 +146,13 @@
} else { // fixed (this isn't an option now but was default before imagesize added to xwd)
imgMaxW = 400; // desktop / tablet
imgMaxH = 400;
if (x_browserInfo.mobile == true) {
imgMaxW = 250; // mobile
imgMaxH = 250;
}
}

imgMaxH -= $("#shorturltodisplay").outerHeight();

if (x_currentPageXML.getAttribute("sound") != undefined && x_currentPageXML.getAttribute("sound") != "") {
imgMaxH -= x_audioBarH;
}

return {width: Math.min(imgMaxW, imgMaxH), height: Math.min(imgMaxW, imgMaxH)};
}

Expand Down

0 comments on commit 1e09e6b

Please sign in to comment.