From bd0b82d12f754a451e8fca420c93dac6fbd6f1de Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Wed, 15 Feb 2023 22:04:20 +0000 Subject: [PATCH] Change detection type for use of printing stylesheet --- www/js/lib/uiUtil.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/lib/uiUtil.js b/www/js/lib/uiUtil.js index 7d0bfda2..c30c6871 100644 --- a/www/js/lib/uiUtil.js +++ b/www/js/lib/uiUtil.js @@ -205,7 +205,7 @@ define(rqDef, function(util) { //var innerDocument = window.frames[0].frameElement.contentDocument; var innerDocument = document.getElementById('articleContent').contentDocument; // For now, adding a printing stylesheet to a zimit ZIM appears to diasble printing of any images! - if (params.zimType === 'open') { + if (appstate.wikimediaZimLoaded) { //Add any missing classes innerDocument.body.innerHTML = innerDocument.body.innerHTML.replace(/(class\s*=\s*["'][^"']*vcard\b[^>]+>\s*/ig, '$1 class="map-pin">'); // Remove encapsulated External Links @@ -255,7 +255,7 @@ define(rqDef, function(util) { var sliderVal = document.getElementById("documentZoomSlider").value; sliderVal = ~~sliderVal; sliderVal = Math.floor(sliderVal * (Math.max(window.screen.width, window.screen.height) / 1440)); - if (params.zimType === 'open') { + if (appstate.wikimediaZimLoaded) { printStyleInnerHTML += "body { font-size: " + sliderVal + "% !important; } "; printStyleInnerHTML += "}"; printOptions.innerHTML = printStyleInnerHTML;