mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
make dialog content accessible
screen readers announce alert dialogs
This commit is contained in:
parent
de453ad03d
commit
482a8b17d9
@ -324,7 +324,7 @@
|
||||
min-width: 88px;
|
||||
}
|
||||
|
||||
nav {
|
||||
nav, section {
|
||||
padding: @alertify_padding-base;
|
||||
text-align: right;
|
||||
button, div.cp-button-confirm {
|
||||
|
||||
@ -66,7 +66,7 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
nav {
|
||||
nav, section {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-end;
|
||||
|
||||
@ -196,7 +196,7 @@ define([
|
||||
};
|
||||
|
||||
dialog.nav = function (content) {
|
||||
return h('nav', content || [
|
||||
return h('section', content || [
|
||||
dialog.cancelButton(),
|
||||
dialog.okButton(),
|
||||
]);
|
||||
@ -212,6 +212,12 @@ define([
|
||||
h('div'+cls, content),
|
||||
])
|
||||
]);
|
||||
|
||||
var dialogContent = frame.querySelector('div' + cls);
|
||||
dialogContent.setAttribute('aria-live', 'assertive');
|
||||
dialogContent.setAttribute('role', 'alertdialog');
|
||||
dialogContent.setAttribute('aria-modal', 'true');
|
||||
|
||||
var $frame = $(frame);
|
||||
frame.closeModal = function (cb) {
|
||||
frame.closeModal = function () {}; // Prevent further calls
|
||||
|
||||
Loading…
Reference in New Issue
Block a user