From c8559792e1f9d949e4664c660f87f068cf8711fa Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Fri, 19 Feb 2021 13:26:55 +0300 Subject: [PATCH] [SSE] fixed launch for scaled DiagramEditor --- apps/common/main/lib/util/htmlutils.js | 9 +++++++++ apps/spreadsheeteditor/main/index.html | 4 ---- apps/spreadsheeteditor/main/index.html.deploy | 4 ---- apps/spreadsheeteditor/main/index_internal.html | 3 +-- apps/spreadsheeteditor/main/index_internal.html.deploy | 5 +---- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index a5d6822a5..f6e5384c3 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -5,6 +5,15 @@ function checkScaling() { if ( window.matchMedia(str_mq_150).matches ) { document.body.classList.add('pixel-ratio__1_5'); } + + if ( !window.matchMedia("screen and (-webkit-device-pixel-ratio: 1.5)," + + "screen and (-webkit-device-pixel-ratio: 1)," + + "screen and (-webkit-device-pixel-ratio: 2)").matches ) + { + // don't add zoom for mobile devices + if (!(/android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera))) + document.getElementsByTagName('html')[0].setAttribute('style', 'zoom: ' + (1 / window.devicePixelRatio) + ';'); + } } checkScaling(); diff --git a/apps/spreadsheeteditor/main/index.html b/apps/spreadsheeteditor/main/index.html index a25ef410a..b117371d5 100644 --- a/apps/spreadsheeteditor/main/index.html +++ b/apps/spreadsheeteditor/main/index.html @@ -184,10 +184,6 @@
diff --git a/apps/spreadsheeteditor/main/index_internal.html.deploy b/apps/spreadsheeteditor/main/index_internal.html.deploy index 5abd0e270..fe915e9e5 100644 --- a/apps/spreadsheeteditor/main/index_internal.html.deploy +++ b/apps/spreadsheeteditor/main/index_internal.html.deploy @@ -113,10 +113,6 @@