diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 5442dd080..a5e53eecf 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -4960,6 +4960,7 @@ function Ace2Inner(){ function focus() { + top.console.log("window.focus there is a bug with me in FF"); window.focus(); } diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 7edf73bab..42cd50f4b 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -225,6 +225,16 @@ var chat = (function() } }); + $('body:not(#chatinput)').on("keydown", function(evt){ + if (evt.altKey && evt.which == 67){ + // Alt c focuses on the Chat window + $(this).blur(); + parent.parent.chat.show(); + parent.parent.chat.focus(); + evt.preventDefault(); + } + }); + $("#chatinput").keypress(function(evt){ //if the user typed enter, fire the send if(evt.which == 13 || evt.which == 10) diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 8df6e693e..991c85949 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -156,8 +156,8 @@ var padeditbar = (function() }); }); - $('#editbar, .popup').on("keydown", function(evt){ - editbarKeyEvent(evt); + $('body:not(#editorcontainerbox)').on("keydown", function(evt){ + bodyKeyEvent(evt); }); $('#editbar').show(); @@ -307,10 +307,10 @@ var padeditbar = (function() var editbarPosition = 0; - function editbarKeyEvent(evt){ + function bodyKeyEvent(evt){ // 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((evt.keyCode === 120 && evt.altKey) || evt.keyCode === 27){ // If we're in the editbar already.. // Close any dropdowns we have open.. padeditbar.toggleDropDown("none"); @@ -318,6 +318,8 @@ var padeditbar = (function() // Shift focus away from any drop downs $(':focus').blur(); // required to do not try to remove! padeditor.ace.focus(); // Sends focus back to pad + // The above focus doesn't always work in FF, you have to hit enter afterwards + // This still needs fixing cake } // On arrow keys go to next/previous button item in editbar