From 41ff201dca954f7cf32599861a6cf7cb383d4155 Mon Sep 17 00:00:00 2001 From: MinRK Date: Wed, 12 Jun 2013 22:26:30 -0400 Subject: [PATCH] fix raw_input double-focus, size, and use `val()` instead of `attr("value")` --- .../html/notebook/static/notebook/js/outputarea.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/IPython/frontend/html/notebook/static/notebook/js/outputarea.js b/IPython/frontend/html/notebook/static/notebook/js/outputarea.js index a56ba4d47..3f4baf124 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',