diff options
author | Prateek Saxena <prtksxna@gmail.com> | 2014-10-14 18:36:26 +0530 |
---|---|---|
committer | Prateek Saxena <prtksxna@gmail.com> | 2014-10-14 18:37:35 +0530 |
commit | 6f5f89bc6bea456cf8af9d034780b5b259ca74a5 (patch) | |
tree | 325c40c373650b7f4709c0c67a4ae13c4e7ec31c /src/static/js | |
parent | 68c805070ab565977633e7f6e99150bb22b0d4f5 (diff) | |
download | etherpad-lite-6f5f89bc6bea456cf8af9d034780b5b259ca74a5.zip |
Use 'evt.shiftKey' instead of matching 'charCodes'
The shortcut wasn't running consistently and was blocking
'Cmd+L' on Chrome 38. Instead of going to the location bar
it would tooggle the list. Strangely, it did not override
'Cmd+N'. Using `evt.shiftKey` instead of matching the `charCode`
to the uppercase letter solves the problem.
Diffstat (limited to 'src/static/js')
-rw-r--r-- | src/static/js/ace2_inner.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 5244cbca..fb6dd080 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3749,7 +3749,7 @@ function Ace2Inner(){ toggleAttributeOnSelection('strikethrough'); specialHandled = true; } - if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which) == "L" && (evt.metaKey || evt.ctrlKey)) + if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "l" && (evt.metaKey || evt.ctrlKey) && evt.shiftKey) { // cmd-shift-L (unorderedlist) fastIncorp(9); @@ -3757,7 +3757,7 @@ function Ace2Inner(){ doInsertUnorderedList() specialHandled = true; } - if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which) == "N" && (evt.metaKey || evt.ctrlKey)) + if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "n" && (evt.metaKey || evt.ctrlKey) && evt.shiftKey) { // cmd-shift-N (orderedlist) fastIncorp(9); |