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

accessbileChange event firing twice

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_39_STABLE

      Description

      Must use Boost theme.

      Open an assignment with submissions.

      Click View Submissions.

      On the top of the page, Click the drop down box labeled: "Grading actions"

      Click "Download all submissions"

       

      The download box will show twice.

       

      I traced it down to the accessibleChange custom event found here (lib\templates\url_select.mustache)

       

      {{#js}}
              require(['jquery', 'core/custom_interaction_events'], function($, CustomEvents) {
                  CustomEvents.define('#{{id}}', [CustomEvents.events.accessibleChange]);
                  $('#{{id}}').on(CustomEvents.events.accessibleChange, function() {
                      if (!$(this).val()) {
                          return false;
                      }
                      $('#{{formid}}').submit();
                  });
              });
          {{/js}}
      

      if I add $('#id').unbind("click"); before the .on() it fires only once, However, this is not a complete fix.  It requires a click outside the select box to fire.

        Attachments

        1. custom_interaction_events.js.patch
          0.8 kB
          Tim Lock
        2. download_all_submissions.png
          133 kB
          Sujith Haridasan

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              syxton Matthew Davidson
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: