Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 255: Line 255:
             if (group.length > 0) { groupedSources.push({ title: layoutGroup.title, sources: group }); }
             if (group.length > 0) { groupedSources.push({ title: layoutGroup.title, sources: group }); }
         }
         }
         groupedSources.push({ title: 'More', sources: sourcesCopy });
         groupedSources.push({ title: 'More platforms', sources: sourcesCopy });


         let dataSourceFilterHtml = '';
         let dataSourceFilterHtml = '';
         groupedSources.forEach(group => {
         groupedSources.forEach(group => {
             const groupHeaderHtml = '<div class="filter-group-header">' + group.title + '</div>';
             dataSourceFilterHtml += '<div class="filter-group-header">' + group.title + '</div>';
             dataSourceFilterHtml += group.sources.reduce((acc, curr, idx) => {
             dataSourceFilterHtml += group.sources.reduce((acc, curr, idx) => {
                 const identifier = escapeAttr(curr.name);
                 const identifier = escapeAttr(curr.name);
                 return acc +  
                 return acc +
                 '<div ' + (idx === 0 ? ' class="filter-group-start">' + groupHeaderHtml : '>') +  
                 '<div ' + (idx === 0 ? ' class="filter-group-start">' : '>') +  
                 '<input type="checkbox" id="filter-' + identifier + '" value="' + curr.name + '" checked>' +
                 '<input type="checkbox" id="filter-' + identifier + '" value="' + curr.name + '" checked>' +
                 '<label for="filter-' + identifier + '"><img src="' + curr.image + '"> ' + curr.name + '</label></div>'
                 '<label for="filter-' + identifier + '"><img src="' + curr.image + '"> ' + curr.name + '</label></div>'

Revision as of 12:13, 15 June 2022

Development verstion of the DCT List.
Not ready for production!