mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
more keyboard support while in editbar
This commit is contained in:
parent
6b88c037b8
commit
548cef7018
1 changed files with 7 additions and 3 deletions
|
@ -156,7 +156,7 @@ var padeditbar = (function()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#editbar').on("keydown", function(evt){
|
$('#editbar, .popup').on("keydown", function(evt){
|
||||||
editbarKeyEvent(evt);
|
editbarKeyEvent(evt);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -308,12 +308,16 @@ var padeditbar = (function()
|
||||||
var editbarPosition = 0;
|
var editbarPosition = 0;
|
||||||
|
|
||||||
function editbarKeyEvent(evt){
|
function editbarKeyEvent(evt){
|
||||||
// If the event is Alt F9 (we're already in the editbar menu
|
// If the event is Alt F9 or Escape & we're already in the editbar menu
|
||||||
// Send the users focus back to the pad
|
// Send the users focus back to the pad
|
||||||
if(evt.keyCode === 120 || evt.keyCode === 27){
|
if(evt.keyCode === 120 || evt.keyCode === 27){
|
||||||
// If we're in the editbar already..
|
// If we're in the editbar already..
|
||||||
|
// Close any dropdowns we have open..
|
||||||
|
padeditbar.toggleDropDown("none");
|
||||||
|
|
||||||
|
// Shift focus away from any drop downs
|
||||||
$(':focus').blur(); // required to do not try to remove!
|
$(':focus').blur(); // required to do not try to remove!
|
||||||
padeditor.ace.focus(); // Sends focus back
|
padeditor.ace.focus(); // Sends focus back to pad
|
||||||
}
|
}
|
||||||
|
|
||||||
// On arrow keys go to next/previous button item in editbar
|
// On arrow keys go to next/previous button item in editbar
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue