From fb2bed4adeb9d8ba8aad4dba6c1cf75fcec94344 2013-06-13 02:26:30 From: MinRK Date: 2013-06-13 02:26:30 Subject: [PATCH] fix raw_input double-focus, size, and use `val()` instead of `attr("value")` --- diff --git a/IPython/frontend/html/notebook/static/notebook/js/outputarea.js b/IPython/frontend/html/notebook/static/notebook/js/outputarea.js index a56ba4d..3f4baf1 100644 --- a/IPython/frontend/html/notebook/static/notebook/js/outputarea.js +++ b/IPython/frontend/html/notebook/static/notebook/js/outputarea.js @@ -546,7 +546,7 @@ var IPython = (function (IPython) { $("") .addClass("raw_input") .attr('type', 'text') - .attr("size", 80) + .attr("size", 47) .keydown(function (event, ui) { // make sure we submit on enter, // and don't re-execute the *cell* on shift-enter @@ -558,13 +558,15 @@ var IPython = (function (IPython) { ) ); this.element.append(area); - area.find("input.raw_input").focus(); + // weirdly need double-focus now, + // otherwise only the cell will be focused + area.find("input.raw_input").focus().focus(); } OutputArea.prototype._submit_raw_input = function (evt) { var container = this.element.find("div.raw_input"); var theprompt = container.find("span.input_prompt"); var theinput = container.find("input.raw_input"); - var value = theinput.attr("value"); + var value = theinput.val(); var content = { output_type : 'stream', name : 'stdout',