[Slider] Transpile
This commit is contained in:
@@ -153,7 +153,6 @@ var loadImageType = (name) => {
|
|||||||
sliderElements.forEach(el => {
|
sliderElements.forEach(el => {
|
||||||
const baseURL = el.dataset.imageBaseURL;
|
const baseURL = el.dataset.imageBaseURL;
|
||||||
const filetype = el.dataset.filetype;
|
const filetype = el.dataset.filetype;
|
||||||
// TODO: Verification (i.e. baseURL cannot contain .something in the end, filetype may only be jpg, jpeg, webp, svg or png)
|
|
||||||
if (allowedExtensions.indexOf(filetype) === -1) {
|
if (allowedExtensions.indexOf(filetype) === -1) {
|
||||||
console.warn('[ SLIDER ] Invalid filetype ' + filetype + ' for image element with id ' + el.id);
|
console.warn('[ SLIDER ] Invalid filetype ' + filetype + ' for image element with id ' + el.id);
|
||||||
return;
|
return;
|
||||||
@@ -162,7 +161,7 @@ var loadImageType = (name) => {
|
|||||||
console.warn('[ SLIDER ] ImageBaseURL incorrect for image element with id ' + el.id);
|
console.warn('[ SLIDER ] ImageBaseURL incorrect for image element with id ' + el.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
el.style.setProperty('background-image', baseURL + name + filetype);
|
el.style.setProperty('background-image', `url(${baseURL}${name}${filetype})`);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
for (const el in fetchedElements) {
|
for (const el in fetchedElements) {
|
||||||
|
|||||||
Reference in New Issue
Block a user