Merge branch 'MDL-64493-master' of git://github.com/damyon/moodle

This commit is contained in:
Jun Pataleta 2019-02-12 10:12:21 +08:00
commit ae242c33f8
2 changed files with 5 additions and 4 deletions

View File

@ -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);
});
}

View File

@ -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 {