Permalink
Browse files

Intercept <esc> avoid closing websocket on Firefox

Closes #1031; closes #1032 (rebased and fixed tiny typo)
  • Loading branch information...
Carreau authored and fperez committed Nov 23, 2011
1 parent 4ab240d commit a329ff026ea3e33ea09bc8d833e6614b6df3de76
Showing with 5 additions and 0 deletions.
  1. +5 −0 IPython/frontend/html/notebook/static/js/notebook.js
@@ -57,6 +57,11 @@ var IPython = (function (IPython) {
$(document).keydown(function (event) {
// console.log(event);
if (that.read_only) return;
+ if (event.which === 27) {
+ // Intercept escape at highest level to avoid closing
+ // websocket connection with firefox
+ event.preventDefault();
+ }
if (event.which === 38) {
var cell = that.selected_cell();
if (cell.at_top()) {

0 comments on commit a329ff0

Please sign in to comment.