Difference between revisions of "Widget:DevGuidelines"

From LINKS Community Center
Jump to: navigation, search
Line 560: Line 560:
 
                     {
 
                     {
 
                         title: 'Supported Platforms',
 
                         title: 'Supported Platforms',
                         field: 'dataSources',
+
                         field: DATASRC_PROP,
 
                         minWidth: 300, // required for responsiveness when using fitColumns
 
                         minWidth: 300, // required for responsiveness when using fitColumns
 
                         cssClass: 'data-sources-cell',
 
                         cssClass: 'data-sources-cell',
Line 659: Line 659:
 
                     summary.innerHTML = summaryHtml;
 
                     summary.innerHTML = summaryHtml;
 
                 }
 
                 }
 +
 +
                const markImages = () => {
 +
                    const selectedSources = filter.type.dataSources;
 +
                    const selectedFunctions = filter.type.functions;
 +
 +
                    // Mark data source images
 +
                    document.querySelectorAll('.data-sources-cell .data-source-img, .tabulator-responsive-collapse .data-source-img')
 +
                        .forEach(img => {
 +
                            if (!selectedSources || selectedSources.includes(img.dataset.value)) { img.classList.remove('unselected'); }
 +
                            else { img.classList.add('unselected'); }
 +
                        });
 +
 +
                    // Mark functions images
 +
                    document.querySelectorAll('.functions-cell .func-img').forEach(img => {
 +
                        if (!selectedFunctions || selectedFunctions.includes(img.dataset.value)) { img.classList.remove('unselected'); }
 +
                        else { img.classList.add('unselected'); }
 +
                    });
 +
 +
                    tabulator.off('renderComplete', markImages);
 +
                }
 +
                tabulator.on('renderComplete', markImages); // TODO: Prevent this from running if corresponding filters are not active.
 
             });
 
             });
  

Revision as of 13:12, 24 November 2022

Development version of the List of Guidelines.
Not ready for production!