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

Prevent repeated clicking on actionable links (like add a new block -> html)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7
    • Fix Version/s: None
    • Component/s: JavaScript, Usability
    • Labels:
      None
    • Affected Branches:
      MOODLE_37_STABLE

      Description

      Various places on the Moodle system are using links (A HTML element) for actions that modify the Moodle database - add/remove data, i.e "Add blocks > HTML".

      Clicking the "Add block" (once) and then "HTML block" rapidly will cause adding of several "HTML" blocks to the page.

      I suggest preventing the ability for the user to click more then once on that link.

      Something along the lines of:

      $(".list-group-item.list-group-item-action").on("click", function(event) {
         if ($(this).hasClass('clicked'))

      {       event.preventDefault();        return false;     }

      else

      {        $(this).addClass('clicked').trigger('click');    }

      });

      But, without the use of jquery, of course.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nadavkav Nadav Kavalerchik
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta, Barbara Ramiro, Jake Dallimore, Jun Pataleta
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: