mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-68167 user: filter elements should listen to accessibleChange event
This commit is contained in:
parent
15a349dd4f
commit
ceda24637d
3 changed files with 7 additions and 3 deletions
2
user/amd/build/participantsfilter.min.js
vendored
2
user/amd/build/participantsfilter.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -30,6 +30,8 @@ import Notification from 'core/notification';
|
||||||
import Pending from 'core/pending';
|
import Pending from 'core/pending';
|
||||||
import Selectors from './local/participantsfilter/selectors';
|
import Selectors from './local/participantsfilter/selectors';
|
||||||
import Templates from 'core/templates';
|
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.
|
* 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.
|
// 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);
|
const typeField = e.target.closest(Selectors.filter.fields.type);
|
||||||
if (typeField && typeField.value) {
|
if (typeField && typeField.value) {
|
||||||
const filter = e.target.closest(Selectors.filter.region);
|
const filter = e.target.closest(Selectors.filter.region);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue