Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82204

Moodle Modal API should provide an easy way to add an overall help icon to a modal

XMLWordPrintable

    • 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.

            Unassigned Unassigned
            timhunt Tim Hunt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.