Difference between revisions of "Widget:GuidelinesList"

From LINKS Community Center
Jump to: navigation, search
Line 637: Line 637:
 
                 if (encoded) {
 
                 if (encoded) {
 
                     const actions = JSON.parse(decodeURIComponent(atob(encoded)));
 
                     const actions = JSON.parse(decodeURIComponent(atob(encoded)));
 +
                    const filter = actions.filter;
  
                    const filter = actions.filter;
 
 
                     if (filter) {
 
                     if (filter) {
 
                         const thematic = filter[THEME_PROP];
 
                         const thematic = filter[THEME_PROP];
Line 649: Line 649:
  
 
                             document.getElementById('thematic-filter').closest('.filter-wrapper').classList.toggle('open');
 
                             document.getElementById('thematic-filter').closest('.filter-wrapper').classList.toggle('open');
 +
                        }
 +
 +
                        const audience = filter[TA_PROP];
 +
                        if (audience) {
 +
                            Object.keys(audience).forEach(ta => {
 +
                                const box = document.getElementById('target-audience-filter-' + escapeAttr(ta));
 +
                                box.checked = !!audience[ta];
 +
                                box.dispatchEvent(new Event('change', { bubbles: true }));
 +
                            });
 +
 +
                            document.getElementById('target-audience-filter').closest('.filter-wrapper').classList.toggle('open');
 
                         }
 
                         }
  

Revision as of 13:13, 23 June 2023

Current version of the List of Guidelines.
Currently in use!