summaryrefslogtreecommitdiff
path: root/src/static/js
diff options
context:
space:
mode:
authorPrateek Saxena <prtksxna@gmail.com>2014-10-14 18:36:26 +0530
committerPrateek Saxena <prtksxna@gmail.com>2014-10-14 18:37:35 +0530
commit6f5f89bc6bea456cf8af9d034780b5b259ca74a5 (patch)
tree325c40c373650b7f4709c0c67a4ae13c4e7ec31c /src/static/js
parent68c805070ab565977633e7f6e99150bb22b0d4f5 (diff)
downloadetherpad-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.js4
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);