Skip to content

Commit e1ba007

Browse files
authored
Merge pull request #2431 from acrule/paste-enable-action-link
Redirect paste menu items to call actions
2 parents b93820b + e928e21 commit e1ba007

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

notebook/static/notebook/js/actions.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ define(function(require){
283283
env.notebook.copy_cell();
284284
}
285285
},
286+
'paste-cell-replace' : {
287+
help: 'paste cells replace',
288+
handler : function (env) {
289+
env.notebook.paste_cell_replace();
290+
}
291+
},
286292
'paste-cell-above' : {
287293
help: 'paste cells above',
288294
help_index : 'eg',

notebook/static/notebook/js/notebook.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,11 +1567,14 @@ define([
15671567
var that = this;
15681568
if (!this.paste_enabled) {
15691569
$('#paste_cell_replace').removeClass('disabled')
1570-
.on('click', function () {that.paste_cell_replace();});
1570+
.on('click', function () {that.keyboard_manager.actions.call(
1571+
'jupyter-notebook:paste-cell-replace');});
15711572
$('#paste_cell_above').removeClass('disabled')
1572-
.on('click', function () {that.paste_cell_above();});
1573+
.on('click', function () {that.keyboard_manager.actions.call(
1574+
'jupyter-notebook:paste-cell-above');});
15731575
$('#paste_cell_below').removeClass('disabled')
1574-
.on('click', function () {that.paste_cell_below();});
1576+
.on('click', function () {that.keyboard_manager.actions.call(
1577+
'jupyter-notebook:paste-cell-below');});
15751578
this.paste_enabled = true;
15761579
}
15771580
};

0 commit comments

Comments
 (0)