to_code -> cells_to_code to handle muliple selected cells

Pierre Gerold 10 years ago committed by Peter Parente
parent cdd59fd140
commit e3299328d2

@ -243,11 +243,11 @@ define(function(require){
env.notebook.focus_cell();
}
},
'change-cell-to-code' : {
'change-cell(s)-to-code' : {
help : 'to code',
help_index : 'ca',
handler : function (env) {
env.notebook.to_code();
env.notebook.cells_to_code();
}
},
'change-cell-to-markdown' : {

@ -1176,7 +1176,18 @@ define(function (require) {
var len = this.ncells();
return this.insert_cell_below(type,len-1);
};
Notebook.prototype.cells_to_code = function (indices) {
if (indices === undefined){
indices = this.get_selected_cells_indices();
}
this.untocode_backup =[];
for (var i=0; i <indices.length; i++){
this.to_code(indices[i])
}
}
/**
* Turn a cell into a code cell.
*

Loading…
Cancel
Save