From 3689be16a26bd3f95eda6c57a4232952f6a87eca Mon Sep 17 00:00:00 2001 From: Matt Enlow Date: Mon, 30 Jun 2014 12:29:36 -0600 Subject: [PATCH] Use Device.js to determine mobile editor use Ref #2570 - Adds new library, device.js to determine if the user is on an ios mobile or tablet. --- ghost/admin/utils/codemirror-mobile.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ghost/admin/utils/codemirror-mobile.js b/ghost/admin/utils/codemirror-mobile.js index 12e5a40fde..c6b61af112 100644 --- a/ghost/admin/utils/codemirror-mobile.js +++ b/ghost/admin/utils/codemirror-mobile.js @@ -1,4 +1,4 @@ -/*global CodeMirror*/ +/*global CodeMirror, device*/ import mobileUtils from 'ghost/utils/mobile-utils'; import createTouchEditor from 'ghost/assets/lib/touch-editor'; @@ -24,7 +24,9 @@ setupMobileCodeMirror = function setupMobileCodeMirror() { }; init = function init() { - if (mobileUtils.hasTouchScreen()) { + //Codemirror does not function on mobile devices, + // nor on any iDevice. + if (device.mobile() || (device.tablet() && device.ios())) { $('body').addClass('touch-editor'); // make editor tabs touch-to-toggle in portrait mode