Skip to content

Commit

Permalink
remove click event add/removal in enable/disable_paste
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarrad Whitaker authored and Nelyus committed Jun 10, 2020
1 parent 5b986fc commit 946d086
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions notebook/static/notebook/js/notebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -1619,17 +1619,11 @@ define([
var that = this;
if (!this.paste_enabled) {
$('#paste_cell_replace').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-replace');});
$('#paste_cell_replace > a').attr('aria-disabled', 'false');
$('#paste_cell_replace > a').attr('aria-disabled', 'false');
$('#paste_cell_above').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-above');});
$('#paste_cell_above > a').attr('aria-disabled', 'false');
$('#paste_cell_above > a').attr('aria-disabled', 'false');
$('#paste_cell_below').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-below');});
$('#paste_cell_below > a').attr('aria-disabled', 'false');
$('#paste_cell_below > a').attr('aria-disabled', 'false');
this.paste_enabled = true;
}
};
Expand All @@ -1639,12 +1633,12 @@ define([
*/
Notebook.prototype.disable_paste = function () {
if (this.paste_enabled) {
$('#paste_cell_replace').addClass('disabled').off('click');
$('#paste_cell_replace > a').attr('aria-disabled', 'true');
$('#paste_cell_above').addClass('disabled').off('click');
$('#paste_cell_above > a').attr('aria-disabled', 'true');
$('#paste_cell_below').addClass('disabled').off('click');
$('#paste_cell_below > a').attr('aria-disabled', 'true');
$('#paste_cell_replace').addClass('disabled');
$('#paste_cell_replace > a').attr('aria-disabled', 'true');
$('#paste_cell_above').addClass('disabled');
$('#paste_cell_above > a').attr('aria-disabled', 'true');
$('#paste_cell_below').addClass('disabled');
$('#paste_cell_below > a').attr('aria-disabled', 'true');
this.paste_enabled = false;
}
};
Expand Down

0 comments on commit 946d086

Please sign in to comment.