From d7970d29a57a697ebc8252758cfb93e8de159562 Mon Sep 17 00:00:00 2001 From: MinRK Date: Thu, 8 Dec 2011 12:46:09 -0800 Subject: [PATCH] skip codemirror key-event handling when read-only --- IPython/frontend/html/notebook/static/js/codecell.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index e34bb6991..8ca5eb6e3 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -66,6 +66,10 @@ var IPython = (function (IPython) { // handlers and is used to provide custom key handling. Its return // value is used to determine if CodeMirror should ignore the event: // true = ignore, false = don't ignore. + + if (this.read_only){ + return false; + } // note that we are comparing and setting the time to wait at each key press. // a better wqy might be to generate a new function on each time change and