1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 01:20:30 +00:00

Add alert role to notifications so they're automatically spoken by screen readers. (#6743)

This commit is contained in:
Nolan Darilek 2022-06-28 11:48:03 -05:00 committed by GitHub
parent f02bd2392f
commit 7ac7d26f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,8 +36,9 @@ Notifier.prototype.display = function(title,options) {
if(!tiddler) { if(!tiddler) {
return; return;
} }
// Add classes // Add classes and roles
$tw.utils.addClass(notification,"tc-notification"); $tw.utils.addClass(notification,"tc-notification");
notification.setAttribute("role","alert");
// Create the variables // Create the variables
var variables = $tw.utils.extend({currentTiddler: title},options.variables); var variables = $tw.utils.extend({currentTiddler: title},options.variables);
// Render the body of the notification // Render the body of the notification