all files / lib/features/keyboard/actions/ RedoAction.js

100% Statements 6/6
80% Branches 4/5
100% Functions 1/1
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                27×   27× 12×   12×              
import {
  isCmd,
  isShift
} from './helpers';
 
var zKeys = ['Z', 'z'];
 
var redoKeys = zKeys.concat('Y', 'y');
 
function redo(context) {
  var key = context.key;
 
  if (isCmd(context.event) && (!zKeys.indexOf(key) > -1 || isShift(context.event))) {
    context.editorActions.trigger('redo');
 
    return true;
  }
}
 
export default {
  keys: redoKeys,
  callback: redo
};