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

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

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 3.7
    • JavaScript, Usability
    • None
    • MOODLE_37_STABLE

      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.

            Unassigned Unassigned
            nadavkav Nadav Kavalerchik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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