mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-07 13:07:22 +08:00
Use offset param instead of direction
This commit is contained in:
parent
c14302e547
commit
c333778a87
@ -177,14 +177,14 @@ define(function(require){
|
||||
help: 'extend marked above',
|
||||
help_index : 'dc',
|
||||
handler : function (env) {
|
||||
env.notebook.extend_marked('up');
|
||||
env.notebook.extend_marked(1);
|
||||
}
|
||||
},
|
||||
'extend-marked-next' : {
|
||||
help: 'extend marked below',
|
||||
help_index : 'dd',
|
||||
handler : function (env) {
|
||||
env.notebook.extend_marked('down');
|
||||
env.notebook.extend_marked(-1);
|
||||
}
|
||||
},
|
||||
'cut-selected-cell' : {
|
||||
|
@ -716,13 +716,10 @@ define(function (require) {
|
||||
/**
|
||||
* Extend the selected range
|
||||
*
|
||||
* @param {string} [direction='down'] - 'up' or 'down
|
||||
* @param {number} offset
|
||||
*/
|
||||
Notebook.prototype.extend_marked = function(direction) {
|
||||
|
||||
// Convert the direction to an index offset
|
||||
var offset = direction === 'up' ? -1 : 1;
|
||||
|
||||
Notebook.prototype.extend_marked = function(offset) {
|
||||
|
||||
// Mark currently selected cell
|
||||
this.get_selected_cell().marked = true;
|
||||
|
||||
|
@ -41,7 +41,7 @@ casper.notebook_test(function () {
|
||||
this.test.assertEquals(this.get_cell_text(1), 'cd', 'split; Verify that cell 1 has the second half.');
|
||||
this.validate_notebook_state('split', 'edit', 1);
|
||||
this.select_cell(0); // Move up to cell 0
|
||||
this.evaluate(function() { IPython.notebook.extend_marked('down');});
|
||||
this.evaluate(function() { IPython.notebook.extend_marked(1);});
|
||||
this.trigger_keydown('shift-m'); // Merge
|
||||
this.validate_notebook_state('merge', 'command', 0);
|
||||
this.test.assertEquals(this.get_cell_text(0), a, 'merge; Verify that cell 0 has the merged contents.');
|
||||
|
Loading…
Reference in New Issue
Block a user