1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00

move requests to backend (#18)

This commit is contained in:
Daniel Waxweiler
2024-04-05 23:26:11 +02:00
committed by GitHub
parent 3269ccca1a
commit dc1949ba4c
37 changed files with 2369 additions and 164 deletions

View File

@ -6,18 +6,14 @@ export function clearEventsList(container) {
list.replaceChildren()
}
export function displayEvents({ data, document, container }) {
export function displayEvents({ events, document, container, maxEventsCount }) {
hideLoadingIndicator(container)
const isShortOffsetNameShown =
window.MOBILIZON_CONNECTOR.isShortOffsetNameShown
const locale = window.MOBILIZON_CONNECTOR.locale
const maxEventsCount = container.getAttribute('data-maximum')
const timeZone = window.MOBILIZON_CONNECTOR.timeZone
const events = data.events
? data.events.elements
: data.group.organizedEvents.elements
const eventsCount = Math.min(maxEventsCount, events.length)
const list = container.querySelector('ul')
for (let i = 0; i < eventsCount; i++) {