[frio] Accessibility: enable keyboard action on visibility panels in compose page

This commit is contained in:
Hypolite Petovan 2019-07-14 22:48:39 -04:00
parent 4f4b538bcf
commit 496b02bdd2

View file

@ -45,6 +45,14 @@
e.stopPropagation()
}
});
// Accessibility: enable space and enter to open a panel when focused
$('body').on('keyup', '[data-toggle="collapse"]:focus', function (e) {
if (e.key === ' ' || e.key === 'Enter') {
$(this).click();
e.preventDefault();
e.stopPropagation();
}
});
$('#visibility-public-panel').on('show.bs.collapse', function() {
$('#visibility-public').prop('checked', true);