From 836fd887dcf0fb853e75a61e08dcdf7d424e9bd6 Mon Sep 17 00:00:00 2001 From: Paul Ivanov Date: Fri, 31 Jan 2014 12:03:30 -0800 Subject: [PATCH] make paste focuses the pasted cell This is to make paste behave in the same manner that insert cell above and below currently work (inserting a new item causes that item to receive focus). This solves a problem where, if a user pastes below a cell whose bottom edge is below the current viewing area, they have no indication that any action has occurred. The same applies for paste above a cell whose top edge is occluded. --- IPython/html/static/notebook/js/notebook.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js index 729557c72..23026cc7d 100644 --- a/IPython/html/static/notebook/js/notebook.js +++ b/IPython/html/static/notebook/js/notebook.js @@ -1040,6 +1040,7 @@ var IPython = (function (IPython) { var cell_data = this.clipboard; var new_cell = this.insert_cell_above(cell_data.cell_type); new_cell.fromJSON(cell_data); + new_cell.focus_cell(); }; }; @@ -1053,6 +1054,7 @@ var IPython = (function (IPython) { var cell_data = this.clipboard; var new_cell = this.insert_cell_below(cell_data.cell_type); new_cell.fromJSON(cell_data); + new_cell.focus_cell(); }; };