-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.5
-
MOODLE_405_STABLE
For the Modal added in MDL-79546, we wanted to have a help icon to explain the dialogue as a whole, and it was agreed that the best way to do that was to add a help icon to the dialgue title bar, and to do that, we had to resort to a bit of a work-around:
modal.getTitlePromise().then((title) => {
|
title.append(' ' + document.getElementById(SELECTORS.regradeAttemptsButtonId).dataset.helpIcon); |
title[0].querySelector('a').classList.add('align-baseline'); // Slightly sad this is needed. |
return title[0]; |
});
|
Instead, it would be nice if the Modal API supported this, e.g. (added proposal is the helpIcon property, but there might be better ideas).
Modal.create({
|
title: getString('regrade', 'quiz_overview'), |
helpIcon: ['regrade', 'quiz_overview'], |
body: Templates.render('quiz_overview/regrade_modal_body', { |
'actionurl': document.querySelector(SELECTORS.mainTableForm).action, |
}),
|
If something like this is ever done, then mod/quiz/report/overview/amd/src/regrade_modal.js should be updated to use it.