mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +03:00
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.
This commit is contained in:
parent
d4222ed87d
commit
3689be16a2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user