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

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.3
    • Component/s: JavaScript
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE

      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

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Jun/12