Skip to content

Commit

Permalink
Use capital keycodes only
Browse files Browse the repository at this point in the history
  • Loading branch information
Park Hyunwoo committed Mar 14, 2016
1 parent 16ccb40 commit c528247
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/js/base/module/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ define([
context.triggerEvent('enter', event);
}
context.triggerEvent('keydown', event);
console.log(event.keyCode);

if (!event.isDefaultPrevented()) {
if (options.shortcuts) {
Expand Down Expand Up @@ -131,13 +132,9 @@ define([
};

this.preventDefaultEditableShortCuts = function (event) {
// B(Bold, 66) / I(Italic, 73) / U(Underline, 85)
if ((event.ctrlKey || event.metaKey) &&
/**
* Bold : B(66) / b(98)
* Italic : I(73) / i(105)
* Underline : U(85) / u(117)
*/
list.contains([66, 98, 73, 105, 85, 117], event.keyCode)) {
list.contains([66, 73, 85], event.keyCode)) {
return false;
}
return true;
Expand Down

0 comments on commit c528247

Please sign in to comment.