From a9a17e7360bc8047c9c95d26d5e5171f6e63e2cc Mon Sep 17 00:00:00 2001 From: 0ip Date: Sat, 31 Dec 2011 17:46:10 +0100 Subject: [PATCH 1/3] properly disables line numbers on mobile devices (fix for #304 and #305) --- static/js/ace2_inner.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 65f8ec7e..a2abbf6e 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -85,6 +85,11 @@ function OUTER(gscope) var doesWrap = true; var hasLineNumbers = true; var isStyled = true; + + // check for mobile os presence + var ua = navigator.userAgent.toLowerCase(); + var isAndroid = ua.indexOf("android") > -1; + var isMobileSafari = ua.indexOf("mobile") > -1; // space around the innermost iframe element var iframePadLeft = MIN_LINEDIV_WIDTH + LINE_NUMBER_PADDING_RIGHT + EDIT_BODY_PADDING_LEFT; @@ -1105,6 +1110,8 @@ function OUTER(gscope) else if (k == "showslinenumbers") { hasLineNumbers = !! value; + // disable line numbers on mobile devices + if(isAndroid || isMobileSafari) hasLineNumbers = false; setClassPresence(sideDiv, "sidedivhidden", !hasLineNumbers); fixView(); } From 2481c1cb4f3f0f087e8608c36ad576ca271e6337 Mon Sep 17 00:00:00 2001 From: 0ip Date: Sat, 31 Dec 2011 17:47:34 +0100 Subject: [PATCH 2/3] removed hackish code --- static/css/pad.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/static/css/pad.css b/static/css/pad.css index a1c48ce2..08a10f8b 100644 --- a/static/css/pad.css +++ b/static/css/pad.css @@ -1246,9 +1246,6 @@ label[for=readonlyinput] { #usericonback { margin-top: 4px; } - #sidediv { - display:none; - } } .rtl{ direction:RTL; From 9203ac2362a0dcb59d4baa54bb81bf865abdb56c Mon Sep 17 00:00:00 2001 From: 0ip Date: Sat, 31 Dec 2011 18:16:50 +0100 Subject: [PATCH 3/3] (1) Support for x*720px phones (like Galaxy Nexus) (2) Fix for user popup --- static/css/pad.css | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/static/css/pad.css b/static/css/pad.css index 08a10f8b..933b7af1 100644 --- a/static/css/pad.css +++ b/static/css/pad.css @@ -1178,7 +1178,7 @@ label[for=readonlyinput] { } } -@media only screen and (min-device-width: 320px) and (max-device-width: 600px) { +@media only screen and (min-device-width: 320px) and (max-device-width: 720px) { #editbar ul li { padding: 4px 3px; } @@ -1190,12 +1190,10 @@ label[for=readonlyinput] { opacity: .8; } #users { - right: none; - left: 30px; + right: 4px; } #mycolorpicker { - right: 0; - left: 0 !important; + left: -72px; /* #mycolorpicker:width - #users:width */ } #editorcontainer { margin-bottom: 33px;