From 7d8e4a4affab3f75b0cd6eed1b89a21468c0e350 2012-06-01 04:59:20 From: Brian E. Granger Date: 2012-06-01 04:59:20 Subject: [PATCH] Merge pull request #1821 from ellisonbg/nbrename-enter ENTER submits the rename notebook dialog. --- diff --git a/IPython/frontend/html/notebook/static/js/savewidget.js b/IPython/frontend/html/notebook/static/js/savewidget.js index 2ffaf31..8471cb3 100644 --- a/IPython/frontend/html/notebook/static/js/savewidget.js +++ b/IPython/frontend/html/notebook/static/js/savewidget.js @@ -94,6 +94,15 @@ var IPython = (function (IPython) { "Cancel": function () { $(this).dialog('close'); } + }, + open : function (event, ui) { + var that = $(this); + // Upon ENTER, click the OK button. + that.find('input[type="text"]').keydown(function (event, ui) { + if (event.which === utils.keycodes.ENTER) { + that.parent().find('button').first().click(); + } + }); } }); }