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

accessbileChange event firing twice

    XMLWordPrintable

Details

    • 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

        Issue Links

          Activity

            People

              Unassigned Unassigned
              syxton Matthew Davidson
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: