Commit 85ccac0a authored by Víctor Déniz's avatar Víctor Déniz
Browse files

Merge branch 'MDL-71543-master_toggleicon' of https://github.com/brickfield/moodle

parents f08cbfa6 0673d72e
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -137,6 +137,10 @@ const showAccessMap = (courseId, displayFormat, updatePreference = false) => {
renderTemplate(element, module.numerrors, module.numchecks, displayFormat, minViews, viewDelta);
});
// Change the icon display.
document.querySelector('.icon-accessmap').classList.remove(...['fa-eye-slash']);
document.querySelector('.icon-accessmap').classList.add(...['fa-eye']);
return {
sectionData,
moduleData,
......@@ -170,6 +174,10 @@ const hideAccessMap = (updatePreference = false) => {
if (updatePreference) {
setToggleStatePreference(false);
}
// Change the icon display.
document.querySelector('.icon-accessmap').classList.remove(...['fa-eye']);
document.querySelector('.icon-accessmap').classList.add(...['fa-eye-slash']);
};
......
......@@ -232,10 +232,16 @@ class block_accessreview extends block_base {
protected function get_toggle_link(): string {
global $OUTPUT;
if (get_user_preferences('block_accessreviewtogglestate')) {
$icon = 't/hide';
} else {
$icon = 't/show';
}
// Toggle overlay link.
return html_writer::link(
'#',
$OUTPUT->pix_icon('t/hide', get_string('togglealt', 'block_accessreview')),
$OUTPUT->pix_icon($icon, get_string('togglealt', 'block_accessreview'), 'moodle', ['class' => 'icon-accessmap']),
[
'title' => get_string('togglealt', 'block_accessreview'),
'style' => 'cursor: pointer;',
......
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