Difference between revisions of "Widget:GuidelinesList"

From LINKS Community Center
Jump to: navigation, search
Line 640: Line 640:
 
                     const filter = actions.filter;
 
                     const filter = actions.filter;
 
                     if (filter) {
 
                     if (filter) {
                        // Functions filter
+
                         const thematic = filter[THEME_PROP];
                         const functions = filter.functions;
+
                         if (thematic) {
                         if (functions) {
+
                             Object.keys(thematic).forEach(theme => {
                             Object.keys(functions).forEach(subfun => {
+
                                 const box = document.getElementById('thematic-filter-' + escapeAttr(theme));
                                 const subfunEl = document.getElementById('subfunc-filter-' + escapeAttr(subfun));
+
                                 box.checked = !!thematic[theme];
                                 subfunEl.checked = !!functions[subfun];
+
                                 box.dispatchEvent(new Event('change', { bubbles: true }));
                                 subfunEl.dispatchEvent(new Event('change', { bubbles: true }));
 
 
                             });
 
                             });
  
                             document.getElementById('functions-filter').closest('.filter-wrapper').classList.toggle('open');
+
                             document.getElementById('thematic-filter').closest('.filter-wrapper').classList.toggle('open');
 
                         }
 
                         }
 
                        // Further filters
 
                        // ...
 
  
 
                         applyFilters();
 
                         applyFilters();

Revision as of 13:01, 23 June 2023

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