Enable Cmd key support in shortcuts

pull/1/head
yflory 7 years ago
parent 12bfcbe701
commit b7b560fcb8

@ -367,7 +367,6 @@ define([
var getThumbnailContainer = function () { var getThumbnailContainer = function () {
var $preview = $('#cp-app-code-preview-content'); var $preview = $('#cp-app-code-preview-content');
var $codeMirror = $('.CodeMirror');
if ($preview.length && $preview.is(':visible')) { if ($preview.length && $preview.is(':visible')) {
return $preview[0]; return $preview[0];
} }

@ -463,7 +463,6 @@ define([
UIElements.createButton = function (common, type, rightside, data, callback) { UIElements.createButton = function (common, type, rightside, data, callback) {
var AppConfig = common.getAppConfig(); var AppConfig = common.getAppConfig();
var button; var button;
var size = "17px";
var sframeChan = common.getSframeChannel(); var sframeChan = common.getSframeChannel();
switch (type) { switch (type) {
case 'export': case 'export':

@ -777,7 +777,7 @@ define([
content: '<span class="fa fa-plus-circle"></span> ' + Messages.creation_appMenuName content: '<span class="fa fa-plus-circle"></span> ' + Messages.creation_appMenuName
}); });
$(window).keydown(function (e) { $(window).keydown(function (e) {
if (e.which === 69 && (e.ctrlKey || e.metaKey)) { if (e.which === 69 && (e.ctrlKey || (navigator.platform === "MacIntel" && e.metaKey))) {
Common.createNewPadModal(); Common.createNewPadModal();
} }
}); });

@ -41,7 +41,8 @@ define([
{ {
var APP = window.APP = { var APP = window.APP = {
editable: false, editable: false,
mobile: function () { return $('body').width() <= 600; } // Menu and content area are not inline-block anymore for mobiles mobile: function () { return $('body').width() <= 600; }, // Menu and content area are not inline-block anymore for mobiles
isMac: navigator.platform === "MacIntel"
}; };
var stringify = function (obj) { var stringify = function (obj) {
@ -549,7 +550,7 @@ define([
} }
// Ctrl+A select all // Ctrl+A select all
if (e.which === 65 && e.ctrlKey) { if (e.which === 65 && (e.ctrlKey || (e.metaKey && APP.isMac))) {
$content.find('.cp-app-drive-element:not(.cp-app-drive-element-selected)') $content.find('.cp-app-drive-element:not(.cp-app-drive-element-selected)')
.addClass('cp-app-drive-element-selected'); .addClass('cp-app-drive-element-selected');
return; return;

@ -556,7 +556,6 @@ define([
}; };
var getThumbnailContainer = function () { var getThumbnailContainer = function () {
var $codeMirror = $('.CodeMirror');
var $c = $('#cp-app-slide-editor'); var $c = $('#cp-app-slide-editor');
if ($c.hasClass('cp-app-slide-preview')) { if ($c.hasClass('cp-app-slide-preview')) {
return $('.cp-app-slide-frame').first()[0]; return $('.cp-app-slide-frame').first()[0];

Loading…
Cancel
Save