mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-01 12:56:54 +08:00
Merge pull request #863 from Carreau/follow-focus
Follow focus while multiselect
This commit is contained in:
commit
55bb4c4437
@ -183,14 +183,22 @@ define(function(require){
|
||||
help: 'extend selected cells above',
|
||||
help_index : 'dc',
|
||||
handler : function (env) {
|
||||
env.notebook.extend_selection_by(-1)
|
||||
env.notebook.extend_selection_by(-1);
|
||||
// scroll into view,
|
||||
// do not call notebook.focus_cell(), or
|
||||
// all the selection get thrown away
|
||||
env.notebook.get_selected_cell().element.focus();
|
||||
}
|
||||
},
|
||||
'extend-selection-below' : {
|
||||
help: 'extend selected cells below',
|
||||
help_index : 'dd',
|
||||
handler : function (env) {
|
||||
env.notebook.extend_selection_by(1)
|
||||
env.notebook.extend_selection_by(1);
|
||||
// scroll into view,
|
||||
// do not call notebook.focus_cell(), or
|
||||
// all the selection get thrown away
|
||||
env.notebook.get_selected_cell().element.focus();
|
||||
}
|
||||
},
|
||||
'cut-cell' : {
|
||||
|
@ -607,7 +607,7 @@ define(function (require) {
|
||||
* @return {Cell} The selected cell
|
||||
*/
|
||||
Notebook.prototype.get_selected_cell = function () {
|
||||
var index = this.get_selected_cells_indices();
|
||||
var index = this.get_selected_index();
|
||||
return this.get_cell(index);
|
||||
};
|
||||
|
||||
@ -711,7 +711,7 @@ define(function (require) {
|
||||
this.get_cell(sindex).unselect(moveanchor);
|
||||
}
|
||||
if(moveanchor){
|
||||
this.get_cell(this.get_anchor_index()).unselect(true);
|
||||
this.get_cell(this.get_anchor_index()).unselect(moveanchor);
|
||||
}
|
||||
var cell = this.get_cell(index);
|
||||
cell.select(moveanchor);
|
||||
|
Loading…
Reference in New Issue
Block a user