Commit 0ad39883 authored by Dan Poltawski's avatar Dan Poltawski
Browse files

MDL-57490 lesson: convert legacy js to jquery

parent d574114a
......@@ -448,8 +448,8 @@ if ($action === 'delete') {
}
echo html_writer::table($table);
if (has_capability('mod/lesson:edit', $context)) {
$checklinks = '<a href="javascript: checkall();">'.get_string('selectall').'</a> / ';
$checklinks .= '<a href="javascript: checknone();">'.get_string('deselectall').'</a>';
$checklinks = '<a id="checkall" href="#">'.get_string('selectall').'</a> / ';
$checklinks .= '<a id="checknone" href="#">'.get_string('deselectall').'</a>';
$checklinks .= html_writer::label('action', 'menuaction', false, array('class' => 'accesshide'));
$options = array('delete' => get_string('deleteselected'));
$attributes = array('id' => 'actionid', 'class' => 'custom-select m-l-1');
......@@ -459,6 +459,14 @@ if ($action === 'delete') {
$('#actionid').change(function() {
$('#mod-lesson-report-form').submit();
});
$('#checkall').click(function() {
$('#mod-lesson-report-form').find('input:checkbox').prop('checked', true);
e.preventDefault();
});
$('#checknone').click(function() {
$('#mod-lesson-report-form').find('input:checkbox').prop('checked', false);
e.preventDefault();
});
});");
echo $OUTPUT->box($checklinks, 'center');
echo '</form>';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment