Support multicell selection in row text conversion

Fixes #804

(c) Copyright IBM Corp. 2015
pull/809/head
Peter Parente 10 years ago
parent e641f5fe1f
commit eb2ad5fcf6

@ -261,7 +261,7 @@ define(function(require){
help : 'to raw',
help_index : 'cc',
handler : function (env) {
env.notebook.to_raw();
env.notebook.cells_to_raw();
}
},
'change-cell-to-heading-1' : {

@ -114,7 +114,7 @@ define([
that.notebook.to_markdown();
break;
case 'raw':
that.notebook.to_raw();
that.notebook.cells_to_raw();
break;
case 'heading':
that.notebook._warn_heading();

@ -1259,6 +1259,21 @@ define(function (require) {
}
};
/**
* Turn one or more cells into a raw text cell.
*
* @param {Array} indices - cell indices to convert
*/
Notebook.prototype.cells_to_raw = function (indices) {
if (indices === undefined) {
indices = this.get_selected_cells_indices();
}
for(var i=0; i < indices.length; i++) {
this.to_raw(indices[i]);
}
};
/**
* Turn a cell into a raw text cell.
*

Loading…
Cancel
Save