mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-20 06:29:53 +01:00
Allow plugins handle "esc" key event
This commit is contained in:
parent
6c68396ed5
commit
959de82e2a
1 changed files with 9 additions and 6 deletions
|
@ -3641,12 +3641,6 @@ function Ace2Inner(){
|
||||||
var altKey = evt.altKey;
|
var altKey = evt.altKey;
|
||||||
var shiftKey = evt.shiftKey;
|
var shiftKey = evt.shiftKey;
|
||||||
|
|
||||||
// prevent ESC key
|
|
||||||
if (keyCode == 27)
|
|
||||||
{
|
|
||||||
evt.preventDefault();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Is caret potentially hidden by the chat button?
|
// Is caret potentially hidden by the chat button?
|
||||||
var myselection = document.getSelection(); // get the current caret selection
|
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
|
var caretOffsetTop = myselection.focusNode.parentNode.offsetTop | myselection.focusNode.offsetTop; // get the carets selection offset in px IE 214
|
||||||
|
@ -3839,6 +3833,15 @@ function Ace2Inner(){
|
||||||
}, 0);
|
}, 0);
|
||||||
specialHandled = true;
|
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 */
|
if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "s" && (evt.metaKey || evt.ctrlKey) && !evt.altKey) /* Do a saved revision on ctrl S */
|
||||||
{
|
{
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
Loading…
Reference in a new issue