mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-05 18:34:39 +03:00
Merge pull request #3157 from novaugust/device
Use Device.js to determine mobile editor use
This commit is contained in:
commit
7d5a776c60
@ -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…
Reference in New Issue
Block a user