diff options
author | John McLear <john@mclear.co.uk> | 2015-03-26 14:26:21 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2015-03-26 14:26:21 +0000 |
commit | 548cef70184989b674184a786affa3e114821529 (patch) | |
tree | aaef4a4adfcd47805952d1d922c59f2cdc21933c | |
parent | 6b88c037b82acd7d92c36adc5d9b2334202cd3a2 (diff) | |
download | etherpad-lite-548cef70184989b674184a786affa3e114821529.zip |
more keyboard support while in editbar
-rw-r--r-- | src/static/js/pad_editbar.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index c71d2b8a..aa9f183b 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -156,7 +156,7 @@ var padeditbar = (function() }); }); - $('#editbar').on("keydown", function(evt){ + $('#editbar, .popup').on("keydown", function(evt){ editbarKeyEvent(evt); }); @@ -308,12 +308,16 @@ var padeditbar = (function() var editbarPosition = 0; 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 if(evt.keyCode === 120 || evt.keyCode === 27){ // 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! - 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 |