Add keyboard shortcuts for the Ctrl+E or Cmd+E modal

This commit is contained in:
yflory
2018-02-28 16:38:28 +01:00
parent dbe8ab014d
commit a4a6385e86
6 changed files with 66 additions and 24 deletions

View File

@@ -768,21 +768,19 @@ define([
content: $('<div>').append(UI.getIcon(p)).html() + Messages.type[p]
});
});
if (Config.displayCreationScreen) {
pads_options.push({
tag: 'a',
attributes: {
id: 'cp-app-toolbar-creation-advanced',
href: origin
},
content: '<span class="fa fa-plus-circle"></span> ' + Messages.creation_appMenuName
});
$(window).keydown(function (e) {
if (e.which === 69 && e.ctrlKey) {
Common.createNewPadModal();
}
});
}
pads_options.push({
tag: 'a',
attributes: {
id: 'cp-app-toolbar-creation-advanced',
href: origin
},
content: '<span class="fa fa-plus-circle"></span> ' + Messages.creation_appMenuName
});
$(window).keydown(function (e) {
if (e.which === 69 && (e.ctrlKey || e.metaKey)) {
Common.createNewPadModal();
}
});
var dropdownConfig = {
text: '', // Button initial text
options: pads_options, // Entries displayed in the menu