MDL-68167 user: filter elements should listen to accessibleChange event
authorShamim Rezaie <shamim@moodle.com>
Tue, 28 Jul 2020 14:22:39 +0000 (00:22 +1000)
committerShamim Rezaie <shamim@moodle.com>
Fri, 30 Oct 2020 03:52:52 +0000 (14:52 +1100)
user/amd/build/participantsfilter.min.js
user/amd/build/participantsfilter.min.js.map
user/amd/src/participantsfilter.js

index f51f237..1f5b3f0 100644 (file)
Binary files a/user/amd/build/participantsfilter.min.js and b/user/amd/build/participantsfilter.min.js differ
index 22cee96..05781b4 100644 (file)
Binary files a/user/amd/build/participantsfilter.min.js.map and b/user/amd/build/participantsfilter.min.js.map differ
index 004020d..3f17241 100644 (file)
@@ -30,6 +30,8 @@ import Notification from 'core/notification';
 import Pending from 'core/pending';
 import Selectors from './local/participantsfilter/selectors';
 import Templates from 'core/templates';
+import CustomEvents from 'core/custom_interaction_events';
+import jQuery from 'jquery';
 
 /**
  * Initialise the participants filter on the element with the given id.
@@ -475,7 +477,9 @@ export const init = participantsRegionId => {
     });
 
     // Add listeners for the filter type selection.
-    filterSet.querySelector(Selectors.filterset.regions.filterlist).addEventListener('change', e => {
+    let filterRegion = jQuery(getFilterRegion());
+    CustomEvents.define(filterRegion, [CustomEvents.events.accessibleChange]);
+    filterRegion.on(CustomEvents.events.accessibleChange, e => {
         const typeField = e.target.closest(Selectors.filter.fields.type);
         if (typeField && typeField.value) {
             const filter = e.target.closest(Selectors.filter.region);