Skip to content

Commit

Permalink
Further fixes issue jupyter#3939 and jupyter#3958 to work on windows …
Browse files Browse the repository at this point in the history
…browsers
  • Loading branch information
fabihaahmed committed Jun 26, 2019
1 parent afea99b commit b4b858a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
19 changes: 12 additions & 7 deletions notebook/static/notebook/js/notebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,8 @@ define([
// This will put all the deleted cells back in one location, rather than
// where they came from. It will do until we have proper undo support.
undelete_backup.index = cursor_ix_after;
$('#undelete_cell').removeClass('disabled').removeAttr("aria-label");

$('#undelete_cell').removeClass('disabled');
$('.undelete_link').removeAttr("aria-disabled");
this.undelete_backup_stack.push(undelete_backup);
this.set_dirty(true);

Expand Down Expand Up @@ -1622,13 +1622,16 @@ define([
if (!this.paste_enabled) {
$('#paste_cell_replace').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-replace');}).removeAttr("aria-label");
'jupyter-notebook:paste-cell-replace');})
$('.paste_replace').removeAttr("aria-disabled");
$('#paste_cell_above').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-above');}).removeAttr("aria-label");
'jupyter-notebook:paste-cell-above');});
$('.paste_above').removeAttr("aria-disabled");
$('#paste_cell_below').removeClass('disabled')
.on('click', function () {that.keyboard_manager.actions.call(
'jupyter-notebook:paste-cell-below');}).removeAttr("aria-label");
'jupyter-notebook:paste-cell-below');});
$('.paste_below').removeAttr("aria-disabled");
this.paste_enabled = true;
}
};
Expand Down Expand Up @@ -1938,7 +1941,8 @@ define([
*/
Notebook.prototype.enable_attachments_paste = function () {
if (!this.paste_attachments_enabled) {
$('#paste_cell_attachments').removeClass('disabled').removeAttr("aria-label");
$('#paste_cell_attachments').removeClass('disabled');
$('.paste_attachments').removeAttr("aria-disabled");
this.paste_attachments_enabled = true;
}
};
Expand All @@ -1948,7 +1952,8 @@ define([
*/
Notebook.prototype.set_insert_image_enabled = function(enabled) {
if (enabled) {
$('#insert_image').removeClass('disabled').removeAttr("aria-label");
$('#insert_image').removeClass('disabled');
$('.image_link').removeAttr("aria-disabled");
} else {
$('#insert_image').addClass('disabled');
}
Expand Down
12 changes: 6 additions & 6 deletions notebook/templates/notebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@
<ul id="edit_menu" class="dropdown-menu" role="menu" aria-labelledby="editlink">
<li id="cut_cell" role="none"><a href="#" role="menuitem">{% trans %}Cut Cells{% endtrans %}</a></li>
<li id="copy_cell" role="none"><a href="#" role="menuitem">{% trans %}Copy Cells{% endtrans %}</a></li>
<li id="paste_cell_above" class="disabled role="none"><a href="#" role="menuitem">{% trans %}Paste Cells Above{% endtrans %}</a></li>
<li id="paste_cell_below" class="disabled" role="none"><a href="#" role="menuitem">{% trans %}Paste Cells Below{% endtrans %}</a></li>
<li id="paste_cell_replace" class="disabled" role="none"><a href="#" role="menuitem">{% trans %}Paste Cells &amp; Replace{% endtrans %}</a></li>
<li id="paste_cell_above" class="disabled" role="none"><a href="#" class="paste_above" role="menuitem" aria-disabled="true">{% trans %}Paste Cells Above{% endtrans %}</a></li>
<li id="paste_cell_below" class="disabled" role="none"><a href="#" class="paste_below" role="menuitem" aria-disabled="true">{% trans %}Paste Cells Below{% endtrans %}</a></li>
<li id="paste_cell_replace" class="disabled" role="none"><a href="#" class="paste_replace" role="menuitem" aria-disabled="true">{% trans %}Paste Cells &amp; Replace{% endtrans %}</a></li>
<li id="delete_cell" role="none"><a href="#" role="menuitem">{% trans %}Delete Cells{% endtrans %}</a></li>
<li id="undelete_cell" class="disabled" role="none"><a href="#" role="menuitem">{% trans %}Undo Delete Cells{% endtrans %}</a></li>
<li id="undelete_cell" class="disabled" role="none"><a href="#" class="undelete_link" role="menuitem" aria-disabled="true">{% trans %}Undo Delete Cells{% endtrans %}</a></li>
<li class="divider" role="none"></li>
<li id="split_cell" role="none"><a href="#" role="menuitem">{% trans %}Split Cell{% endtrans %}</a></li>
<li id="merge_cell_above" role="none"><a href="#" role="menuitem">{% trans %}Merge Cell Above{% endtrans %}</a></li>
Expand All @@ -156,9 +156,9 @@
<li class="divider" role="none"></li>
<li id="cut_cell_attachments" role="none"><a href="#" role="menuitem">{% trans %}Cut Cell Attachments{% endtrans %}</a></li>
<li id="copy_cell_attachments" role="none"><a href="#" role="menuitem">{% trans %}Copy Cell Attachments{% endtrans %}</a></li>
<li id="paste_cell_attachments" class="disabled" role="none"><a href="#" role="menuitem">{% trans %}Paste Cell Attachments{% endtrans %}</a></li>
<li id="paste_cell_attachments" class="disabled" role="none"><a href="#" class="paste_attachments" role="menuitem" aria-disabled="true">{% trans %}Paste Cell Attachments{% endtrans %}</a></li>
<li class="divider" role="none"></li>
<li id="insert_image" class="disabled" role="none"><a href="#" role="menuitem"> {% trans %}Insert Image{% endtrans %} </a></li>
<li id="insert_image" class="disabled" role="none"><a href="#" class="image_link" role="menuitem" aria-disabled="true"> {% trans %}Insert Image{% endtrans %} </a></li>
</ul>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" id="viewlink" data-toggle="dropdown" aria-haspopup="true" aria-controls="view_menu">{% trans %}View{% endtrans %}</a>
Expand Down

0 comments on commit b4b858a

Please sign in to comment.