mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-64493 completion: Manual completion Ally
Do not use duplicate title attributes on buttons, use aria-live to force the correct state to be read after clicking on a button.
This commit is contained in:
parent
c092f75791
commit
7219f590f3
@ -23,7 +23,6 @@ M.core_completion.init = function(Y) {
|
||||
iconkey,
|
||||
button = args.image.get('parentNode');
|
||||
|
||||
|
||||
if (current == 1) {
|
||||
altstr = M.util.get_string('completion-alt-manual-y', 'completion', modulename);
|
||||
iconkey = 'i/completion-manual-y';
|
||||
@ -33,11 +32,13 @@ M.core_completion.init = function(Y) {
|
||||
iconkey = 'i/completion-manual-n';
|
||||
args.state.set('value', 1);
|
||||
}
|
||||
button.set('title', altstr);
|
||||
|
||||
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
||||
Templates.renderPix(iconkey, 'core', altstr).then(function(html) {
|
||||
Templates.replaceNode(args.image.getDOMNode(), html, '');
|
||||
var id = button.get('id'),
|
||||
postFocus = '$(document.getElementById("' + id + '")).focus();';
|
||||
|
||||
Templates.replaceNode(args.image.getDOMNode(), html, postFocus);
|
||||
}).catch(Notification.exception);
|
||||
});
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ class core_course_renderer extends plugin_renderer_base {
|
||||
'type' => 'hidden', 'name' => 'completionstate', 'value' => $newstate));
|
||||
$output .= html_writer::tag('button',
|
||||
$this->output->pix_icon('i/completion-' . $completionicon, $imgalt),
|
||||
array('class' => 'btn btn-link', 'title' => $imgalt));
|
||||
array('class' => 'btn btn-link', 'aria-live' => 'assertive'));
|
||||
$output .= html_writer::end_tag('div');
|
||||
$output .= html_writer::end_tag('form');
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user