mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Merge pull request #4688 from uclixnjupyternbaccessibility/issue-3961
Closes #3961
This commit is contained in:
commit
57cbbe21ee
@ -234,6 +234,7 @@ define([
|
||||
that.select('select-all');
|
||||
}
|
||||
});
|
||||
|
||||
$('#button-select-all').click(function (e) {
|
||||
// toggle checkbox if the click doesn't come from the checkbox already
|
||||
if (!$(e.target).is('input[type=checkbox]')) {
|
||||
@ -811,6 +812,23 @@ define([
|
||||
checked = bidi.applyBidi(checked);
|
||||
$('#counter-select-all').html(checked===0 ? ' ' : checked);
|
||||
|
||||
//#issue 3961, update the checkbox aria-label when it changed
|
||||
if(selected.length>=1){
|
||||
if($('#select-all').prop("checked")){
|
||||
// $('#button-select-all').attr("aria-label", i18n.msg._("Selected All "+ selected.length +" items"));
|
||||
var msg1 = i18n.msg._("Selected All %d items")
|
||||
$('#button-select-all').attr("aria-label", i18n.msg.sprintf(msg1, selected.length));
|
||||
}
|
||||
else{
|
||||
// $('#button-select-all').attr("aria-label", i18n.msg._("Selected, "+ selected.length+" items"));
|
||||
var msg2 = i18n.msg._("Selected, %d items")
|
||||
$('#button-select-all').attr("aria-label", i18n.msg.sprintf(msg2, selected.length));
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#button-select-all').attr("aria-label", i18n.msg._("Select All/None"));
|
||||
}
|
||||
|
||||
// If at aleast on item is selected, hide the selection instructions.
|
||||
if (checked > 0) {
|
||||
$('.dynamic-instructions').hide();
|
||||
|
Loading…
Reference in New Issue
Block a user