From 402e85e99ca36efd6f252b8af2e45241c8f938b3 2013-07-18 18:13:06 From: Min RK Date: 2013-07-18 18:13:06 Subject: [PATCH] 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. --- diff --git a/IPython/html/static/base/js/dialog.js b/IPython/html/static/base/js/dialog.js index 92d2e3c..4154b28 100644 --- a/IPython/html/static/base/js/dialog.js +++ b/IPython/html/static/base/js/dialog.js @@ -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); }