mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
Fix raw_input.
This commit is contained in:
parent
1d9aa63500
commit
a07eabe7c5
@ -588,7 +588,14 @@ var IPython = (function (IPython) {
|
||||
e.on('focusout', function () {
|
||||
that.command_mode();
|
||||
that.enable();
|
||||
})
|
||||
});
|
||||
// There are times (raw_input) where we remove the element from the DOM before
|
||||
// focusout is called. In this case we bind to the remove event of jQueryUI,
|
||||
// which gets triggered upon removal.
|
||||
e.on('remove', function () {
|
||||
that.command_mode();
|
||||
that.enable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -648,11 +648,18 @@ var IPython = (function (IPython) {
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
this.element.append(area);
|
||||
// weirdly need double-focus now,
|
||||
// otherwise only the cell will be focused
|
||||
area.find("input.raw_input").focus().focus();
|
||||
var raw_input = area.find('input.raw_input');
|
||||
// Register events that enable/disable the keyboard manager while raw
|
||||
// input is focused.
|
||||
IPython.keyboard_manager.register_events(raw_input);
|
||||
// Note, the following line used to read raw_input.focus().focus().
|
||||
// This seemed to be needed otherwise only the cell would be focused.
|
||||
// But with the modal UI, this seems to work fine with one call to focus().
|
||||
raw_input.focus();
|
||||
}
|
||||
|
||||
OutputArea.prototype._submit_raw_input = function (evt) {
|
||||
var container = this.element.find("div.raw_input");
|
||||
var theprompt = container.find("span.input_prompt");
|
||||
|
Loading…
Reference in New Issue
Block a user