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

display item's name on JS confirm delete popup dialog when ajax is enabled (course edit mode)

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 2.3
    • 1.9
    • JavaScript
    • None
    • MOODLE_19_STABLE
    • MOODLE_23_STABLE
    • Easy

    Description

      if i enable ajax (site wide) and i turn course editing mode on
      and press the X icon to delete any activity or resource inside the course (on any section)
      a JS popup dialog appears with the item's ID which is non-intuitive (especially for teachers)

      so...

      changing "lib/ajax/section_classes.js" line 817 from :
      if (!confirm(main.getString('deletecheck', main.getString(this.is)+" "+this.id))) {
      to
      if (!confirm(main.getString('deletecheck', main.getString(this.is)+" "+this.getEl().getElementsByTagName('span')[0].textContent))) {

      will display the proper text of that specific activity or resource.
      when poping up that delete confirmation dialog

      using ".textContent" should be cross-browser solution according to "innerText" help tip:
      http://www.quirksmode.org/dom/w3c_html.html#t04

      Attachments

        Issue Links

          Activity

            People

              poltawski Dan Poltawski
              nadavkav Nadav Kavalerchik
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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