mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 04:43:12 +03:00
Merge pull request #3157 from novaugust/device
Use Device.js to determine mobile editor use
This commit is contained in:
commit
14779ffe83
@ -509,6 +509,7 @@ var path = require('path'),
|
||||
'bower_components/showdown/src/showdown.js',
|
||||
'bower_components/moment/moment.js',
|
||||
'bower_components/keymaster/keymaster.js',
|
||||
'bower_components/device/lib/device.js',
|
||||
'bower_components/jquery-ui/ui/jquery-ui.js',
|
||||
'bower_components/jquery-file-upload/js/jquery.fileupload.js',
|
||||
'bower_components/fastclick/lib/fastclick.js',
|
||||
|
@ -4,6 +4,7 @@
|
||||
"backbone": "1.0.0",
|
||||
"codemirror": "4.0.1",
|
||||
"Countable": "2.0.2",
|
||||
"device": "matthewhudson/device.js#5347a275b66020a0d4dfe9aad81a488f8cce448d",
|
||||
"ember": "1.5.0",
|
||||
"ember-data": "~1.0.0-beta.8",
|
||||
"ember-load-initializers": "git://github.com/stefanpenner/ember-load-initializers.git#0.0.1",
|
||||
|
@ -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