Skip to content

Commit b4b858a

Browse files
committed
Further fixes issue jupyter#3939 and jupyter#3958 to work on windows browsers
1 parent afea99b commit b4b858a

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

notebook/static/notebook/js/notebook.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,8 +1216,8 @@ define([
12161216
// This will put all the deleted cells back in one location, rather than
12171217
// where they came from. It will do until we have proper undo support.
12181218
undelete_backup.index = cursor_ix_after;
1219-
$('#undelete_cell').removeClass('disabled').removeAttr("aria-label");
1220-
1219+
$('#undelete_cell').removeClass('disabled');
1220+
$('.undelete_link').removeAttr("aria-disabled");
12211221
this.undelete_backup_stack.push(undelete_backup);
12221222
this.set_dirty(true);
12231223

@@ -1622,13 +1622,16 @@ define([
16221622
if (!this.paste_enabled) {
16231623
$('#paste_cell_replace').removeClass('disabled')
16241624
.on('click', function () {that.keyboard_manager.actions.call(
1625-
'jupyter-notebook:paste-cell-replace');}).removeAttr("aria-label");
1625+
'jupyter-notebook:paste-cell-replace');})
1626+
$('.paste_replace').removeAttr("aria-disabled");
16261627
$('#paste_cell_above').removeClass('disabled')
16271628
.on('click', function () {that.keyboard_manager.actions.call(
1628-
'jupyter-notebook:paste-cell-above');}).removeAttr("aria-label");
1629+
'jupyter-notebook:paste-cell-above');});
1630+
$('.paste_above').removeAttr("aria-disabled");
16291631
$('#paste_cell_below').removeClass('disabled')
16301632
.on('click', function () {that.keyboard_manager.actions.call(
1631-
'jupyter-notebook:paste-cell-below');}).removeAttr("aria-label");
1633+
'jupyter-notebook:paste-cell-below');});
1634+
$('.paste_below').removeAttr("aria-disabled");
16321635
this.paste_enabled = true;
16331636
}
16341637
};
@@ -1938,7 +1941,8 @@ define([
19381941
*/
19391942
Notebook.prototype.enable_attachments_paste = function () {
19401943
if (!this.paste_attachments_enabled) {
1941-
$('#paste_cell_attachments').removeClass('disabled').removeAttr("aria-label");
1944+
$('#paste_cell_attachments').removeClass('disabled');
1945+
$('.paste_attachments').removeAttr("aria-disabled");
19421946
this.paste_attachments_enabled = true;
19431947
}
19441948
};
@@ -1948,7 +1952,8 @@ define([
19481952
*/
19491953
Notebook.prototype.set_insert_image_enabled = function(enabled) {
19501954
if (enabled) {
1951-
$('#insert_image').removeClass('disabled').removeAttr("aria-label");
1955+
$('#insert_image').removeClass('disabled');
1956+
$('.image_link').removeAttr("aria-disabled");
19521957
} else {
19531958
$('#insert_image').addClass('disabled');
19541959
}

notebook/templates/notebook.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@
137137
<ul id="edit_menu" class="dropdown-menu" role="menu" aria-labelledby="editlink">
138138
<li id="cut_cell" role="none"><a href="#" role="menuitem">{% trans %}Cut Cells{% endtrans %}</a></li>
139139
<li id="copy_cell" role="none"><a href="#" role="menuitem">{% trans %}Copy Cells{% endtrans %}</a></li>
140-
<li id="paste_cell_above" class="disabled role="none"><a href="#" role="menuitem">{% trans %}Paste Cells Above{% endtrans %}</a></li>
141-
<li id="paste_cell_below" class="disabled" role="none"><a href="#" role="menuitem">{% trans %}Paste Cells Below{% endtrans %}</a></li>
142-
<li id="paste_cell_replace" class="disabled" role="none"><a href="#" role="menuitem">{% trans %}Paste Cells &amp; Replace{% endtrans %}</a></li>
140+
<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>
141+
<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>
142+
<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>
143143
<li id="delete_cell" role="none"><a href="#" role="menuitem">{% trans %}Delete Cells{% endtrans %}</a></li>
144-
<li id="undelete_cell" class="disabled" role="none"><a href="#" role="menuitem">{% trans %}Undo Delete Cells{% endtrans %}</a></li>
144+
<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>
145145
<li class="divider" role="none"></li>
146146
<li id="split_cell" role="none"><a href="#" role="menuitem">{% trans %}Split Cell{% endtrans %}</a></li>
147147
<li id="merge_cell_above" role="none"><a href="#" role="menuitem">{% trans %}Merge Cell Above{% endtrans %}</a></li>
@@ -156,9 +156,9 @@
156156
<li class="divider" role="none"></li>
157157
<li id="cut_cell_attachments" role="none"><a href="#" role="menuitem">{% trans %}Cut Cell Attachments{% endtrans %}</a></li>
158158
<li id="copy_cell_attachments" role="none"><a href="#" role="menuitem">{% trans %}Copy Cell Attachments{% endtrans %}</a></li>
159-
<li id="paste_cell_attachments" class="disabled" role="none"><a href="#" role="menuitem">{% trans %}Paste Cell Attachments{% endtrans %}</a></li>
159+
<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>
160160
<li class="divider" role="none"></li>
161-
<li id="insert_image" class="disabled" role="none"><a href="#" role="menuitem"> {% trans %}Insert Image{% endtrans %} </a></li>
161+
<li id="insert_image" class="disabled" role="none"><a href="#" class="image_link" role="menuitem" aria-disabled="true"> {% trans %}Insert Image{% endtrans %} </a></li>
162162
</ul>
163163
</li>
164164
<li class="dropdown"><a href="#" class="dropdown-toggle" id="viewlink" data-toggle="dropdown" aria-haspopup="true" aria-controls="view_menu">{% trans %}View{% endtrans %}</a>

0 commit comments

Comments
 (0)