Skip to content
Snippets Groups Projects
Commit bbb1ad33 authored by Christopher Guindon's avatar Christopher Guindon :palm_tree:
Browse files

move collaborations images with content

parent 45bf874c
No related branches found
No related tags found
1 merge request!42move collaborations images with content
......@@ -37,7 +37,7 @@ const weights = {
sparkplug: 50,
};
// An object which uses WG aliases as keys and logo urls as value. Use this only for WGs which do not yet have a logo.
// An object which uses WG aliases as keys and logo urls as value. Use this only for WGs which do not yet have a logo.
const fallbackLogos = {};
const removeDuplicates = (value, index, self) => self.indexOf(value) === index;
......@@ -54,7 +54,7 @@ const getWeightedRandomIndex = (weightBuckets, categorizedArrayByWeight) => {
const weightBucketSelectionIndex = weightBuckets.indexOf(closest);
const weightBucketSelection = weightBuckets[weightBucketSelectionIndex];
const selectionIndex = Math.floor(Math.random() * categorizedArrayByWeight[weightBucketSelection].length);
return categorizedArrayByWeight[weightBucketSelection][selectionIndex];
}
......@@ -112,7 +112,7 @@ async function getWeightedRandomWorkingGroups(count) {
const matchHeightForLogos = (baseElement) => {
const imgElements = baseElement.querySelectorAll('.weighted-working-group-logo');
imgElements.forEach(el => {
imgElements.forEach(el => {
el.addEventListener('load', () => {
$('.weighted-working-group-block-wrapper').matchHeight();
});
......@@ -130,8 +130,8 @@ const getWorkingGroupLogo = ({ alias, logo } = workingGroup) => {
const element = document.querySelector('.eclipsefdn-weighted-working-groups');
if (!element) return;
const options = {
...defaultOptions,
const options = {
...defaultOptions,
...element.dataset,
count: +element.dataset.count
};
......@@ -139,7 +139,7 @@ const getWorkingGroupLogo = ({ alias, logo } = workingGroup) => {
element.innerHTML = template({ isFetching: true, items: new Array(options.count) , wrapperClass: options.wrapperClass })
const [workingGroups, error] = await getWeightedRandomWorkingGroups(options.count);
if (error) {
element.innerHTML = `<p class="alert alert-danger">Error when attempting to load working groups.</p>`;
console.error(error);
......@@ -156,6 +156,6 @@ const getWorkingGroupLogo = ({ alias, logo } = workingGroup) => {
}))
};
element.innerHTML = template(data);
element.innerHTML = template(data);
matchHeightForLogos(element);
})();
\ No newline at end of file
......@@ -15,8 +15,8 @@
<div class="col-md-12 collaborations-collaborating-item-col">
<div class="collaborations-collaborating-item">
<div class="item-icon-wrapper">
<img class="item-icon-bg" src="/images/collaborations/icons/icon-bg.png" alt="" />
<img class="item-icon" src="/images/collaborations/icons/{{ $item.icon }}" alt="" />
<img class="item-icon-bg" src="/collaborations/images/icons/icon-bg.png" alt="" />
<img class="item-icon" src="/collaborations/images/icons/{{ $item.icon }}" alt="" />
</div>
<div class="item-content">
<h3 class="item-content-title">{{ $item.title }}</h3>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment