Merge pull request #3660 from minrk/focusclick

refocus active cell on dialog close

if there is one.

Otherwise the cursor is lost on kernel restart, etc. and the mouse must be used to get back to work.
This commit is contained in:
Min RK 2013-07-18 11:13:06 -07:00
commit a7cf16ce98

View File

@ -64,6 +64,14 @@ IPython.dialog = (function (IPython) {
dialog.remove();
});
}
if (options.reselect_cell !== false) {
dialog.on("hidden", function () {
if (IPython.notebook) {
cell = IPython.notebook.get_selected_cell();
if (cell) cell.select();
}
});
}
return dialog.modal(options);
}