mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05: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 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
/*global CodeMirror*/
|
/*global CodeMirror, device*/
|
||||||
import mobileUtils from 'ghost/utils/mobile-utils';
|
import mobileUtils from 'ghost/utils/mobile-utils';
|
||||||
import createTouchEditor from 'ghost/assets/lib/touch-editor';
|
import createTouchEditor from 'ghost/assets/lib/touch-editor';
|
||||||
|
|
||||||
|
@ -24,7 +24,9 @@ setupMobileCodeMirror = function setupMobileCodeMirror() {
|
||||||
};
|
};
|
||||||
|
|
||||||
init = function init() {
|
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');
|
$('body').addClass('touch-editor');
|
||||||
|
|
||||||
// make editor tabs touch-to-toggle in portrait mode
|
// make editor tabs touch-to-toggle in portrait mode
|
||||||
|
|
Loading…
Add table
Reference in a new issue