diff options
author | John McLear <john@mclear.co.uk> | 2015-11-02 13:08:01 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2015-11-02 13:08:01 +0000 |
commit | 2b980653d6ac679f939b3f5b52352992a47f078a (patch) | |
tree | a37ff5598ad73b53b4b4a034f97e79d7e15aaa6e | |
parent | ba1f9c24d034368f0b70d06a460d3b6c60076767 (diff) | |
parent | 959de82e2a3176425b2b8924ebc919312ba5f5de (diff) | |
download | etherpad-lite-2b980653d6ac679f939b3f5b52352992a47f078a.zip |
Merge pull request #2822 from storytouch/esc
Allow plugins handle "esc" key event
-rw-r--r-- | src/static/js/ace2_inner.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index ebbdea15..7ab4b7b5 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3642,12 +3642,6 @@ function Ace2Inner(){ var altKey = evt.altKey; var shiftKey = evt.shiftKey; - // prevent ESC key - if (keyCode == 27) - { - evt.preventDefault(); - return; - } // Is caret potentially hidden by the chat button? var myselection = document.getSelection(); // get the current caret selection var caretOffsetTop = myselection.focusNode.parentNode.offsetTop | myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214 @@ -3840,6 +3834,15 @@ function Ace2Inner(){ }, 0); specialHandled = true; } + if ((!specialHandled) && isTypeForSpecialKey && keyCode == 27) + { + // prevent esc key; + // in mozilla versions 14-19 avoid reconnecting pad. + + fastIncorp(4); + evt.preventDefault(); + specialHandled = true; + } if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "s" && (evt.metaKey || evt.ctrlKey) && !evt.altKey) /* Do a saved revision on ctrl S */ { evt.preventDefault(); |