also add extra classes to legacy spinner

This commit is contained in:
Bruno Windels 2022-01-17 16:31:13 +01:00
parent 05d23cc745
commit 4bc421527f

View file

@ -20,15 +20,16 @@ export function spinner(t, extraClasses = undefined) {
if (container === undefined) { if (container === undefined) {
container = document.querySelector(".hydrogen"); container = document.querySelector(".hydrogen");
} }
const classes = Object.assign({"spinner": true}, extraClasses);
if (container?.classList.contains("legacy")) { if (container?.classList.contains("legacy")) {
return t.div({className: "spinner"}, [ return t.div({className: classes}, [
t.div(), t.div(),
t.div(), t.div(),
t.div(), t.div(),
t.div(), t.div(),
]); ]);
} else { } else {
return t.svg({className: Object.assign({"spinner": true}, extraClasses), viewBox:"0 0 100 100"}, return t.svg({className: classes, viewBox:"0 0 100 100"},
t.circle({cx:"50%", cy:"50%", r:"45%", pathLength:"100"}) t.circle({cx:"50%", cy:"50%", r:"45%", pathLength:"100"})
); );
} }