From fd6fa31ad9ae2cba256f0548749ad4d38c61ab0e Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 22 Dec 2022 14:15:16 +0100 Subject: [PATCH] Fix autozoom in codemirror editors on mobile --- www/common/sframe-common-codemirror.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/common/sframe-common-codemirror.js b/www/common/sframe-common-codemirror.js index 316a49da5..67ff4d50a 100644 --- a/www/common/sframe-common-codemirror.js +++ b/www/common/sframe-common-codemirror.js @@ -140,10 +140,15 @@ define([ return text.trim(); }; + var isMobile = window.orientation || (typeof(screen) !== "undefined" && screen.orientation); + module.mkIndentSettings = function (editor, metadataMgr) { var setIndentation = function (units, useTabs, fontSize, spellcheck, brackets) { if (typeof(units) !== 'number') { return; } var doc = editor.getDoc(); + if (isMobile && fontSize < 16) { + fontSize = 16; + } editor.setOption('indentUnit', units); editor.setOption('tabSize', units); editor.setOption('indentWithTabs', useTabs);