mirror of
https://github.com/moodle/moodle.git
synced 2025-05-12 03:05:42 +02:00
MDL-62014 course: Add title to activity completion button
This commit is contained in:
parent
9e7c397889
commit
d2d82a9d7d
@ -20,7 +20,8 @@ M.core_completion.init = function(Y) {
|
|||||||
var current = args.state.get('value');
|
var current = args.state.get('value');
|
||||||
var modulename = args.modulename.get('value'),
|
var modulename = args.modulename.get('value'),
|
||||||
altstr,
|
altstr,
|
||||||
iconkey;
|
iconkey,
|
||||||
|
button = args.image.get('parentNode');
|
||||||
|
|
||||||
|
|
||||||
if (current == 1) {
|
if (current == 1) {
|
||||||
@ -32,6 +33,7 @@ M.core_completion.init = function(Y) {
|
|||||||
iconkey = 'i/completion-manual-n';
|
iconkey = 'i/completion-manual-n';
|
||||||
args.state.set('value', 1);
|
args.state.set('value', 1);
|
||||||
}
|
}
|
||||||
|
button.set('title', altstr);
|
||||||
|
|
||||||
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
require(['core/templates', 'core/notification'], function(Templates, Notification) {
|
||||||
Templates.renderPix(iconkey, 'core', altstr).then(function(html) {
|
Templates.renderPix(iconkey, 'core', altstr).then(function(html) {
|
||||||
|
@ -551,7 +551,8 @@ class core_course_renderer extends plugin_renderer_base {
|
|||||||
$output .= html_writer::empty_tag('input', array(
|
$output .= html_writer::empty_tag('input', array(
|
||||||
'type' => 'hidden', 'name' => 'completionstate', 'value' => $newstate));
|
'type' => 'hidden', 'name' => 'completionstate', 'value' => $newstate));
|
||||||
$output .= html_writer::tag('button',
|
$output .= html_writer::tag('button',
|
||||||
$this->output->pix_icon('i/completion-' . $completionicon, $imgalt), array('class' => 'btn btn-link'));
|
$this->output->pix_icon('i/completion-' . $completionicon, $imgalt),
|
||||||
|
array('class' => 'btn btn-link', 'title' => $imgalt));
|
||||||
$output .= html_writer::end_tag('div');
|
$output .= html_writer::end_tag('div');
|
||||||
$output .= html_writer::end_tag('form');
|
$output .= html_writer::end_tag('form');
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user