Skip to content

Commit

Permalink
Merge pull request #331 from bustlelabs/undo-for-pcs
Browse files Browse the repository at this point in the history
Add ctrl+z, ctrl+shift+z key commands for non-mac
  • Loading branch information
bantic committed Feb 19, 2016
2 parents 5af5b44 + 8ad1377 commit 59a1a3b
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/js/editor/key-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export const DEFAULT_KEY_COMMANDS = [{
}, {
str: 'CTRL+A',
run(editor) {
if (!Browser.isMac) {
return false;
}
if (!Browser.isMac) { return false; }
let {range} = editor;
let {head: {section}} = range;
editor.run(postEditor => {
Expand All @@ -68,9 +66,7 @@ export const DEFAULT_KEY_COMMANDS = [{
}, {
str: 'CTRL+E',
run(editor) {
if (!Browser.isMac) {
return false;
}
if (!Browser.isMac) { return false; }
let {range} = editor;
let {tail: {section}} = range;
editor.run(postEditor => {
Expand Down Expand Up @@ -118,6 +114,18 @@ export const DEFAULT_KEY_COMMANDS = [{
postEditor.redoLastChange();
});
}
}, {
str: 'CTRL+Z',
run(editor) {
if (Browser.isMac) { return false; }
editor.run(postEditor => postEditor.undoLastChange());
}
}, {
str: 'CTRL+SHIFT+Z',
run(editor) {
if (Browser.isMac) { return false; }
editor.run(postEditor => postEditor.redoLastChange());
}
}];

function modifierNamesToMask(modiferNames) {
Expand Down

0 comments on commit 59a1a3b

Please sign in to comment.