Widget: DCTList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 388: | Line 388: | ||
let out = ''; | let out = ''; | ||
groupedSources.forEach((group, gIndex) => { | groupedSources.forEach((group, gIndex) => { | ||
if (gIndex === groupedSources.length - 1) { out += '<div class="sources-collapse">'} | |||
out += group.sources.reduce((prev, curr) => { | out += group.sources.reduce((prev, curr) => { | ||
const idx = val.findIndex(src => src === curr.name); | const idx = val.findIndex(src => src === curr.name); | ||
if (idx === -1) { | if (idx === -1) { | ||
return prev | return prev; | ||
} else { | } else { | ||
return curr.image | return curr.image | ||
? prev + '<img class="data-source-img" data-value="' + curr.name + '" src="' + curr.image + '" alt="' + curr.name +'" title="' + curr.name + '">' | ? prev + '<img class="data-source-img" data-value="' + curr.name + '" src="' + curr.image + '" alt="' + curr.name +'" title="' + curr.name + '">' | ||
: prev + ' ' + curr; | : prev + ' ' + curr.name; | ||
} | } | ||
}, ''); | }, ''); | ||
if (gIndex === groupedSources.length - 1) { out += '</div>'} | |||
}); | }); | ||
return out; | return out; |
Revision as of 12:04, 12 July 2022
Development verstion of the DCT List.
Not ready for production!