#26 - Loading animation + success message fix
This commit was merged in pull request #31.
This commit is contained in:
@@ -64,15 +64,18 @@ class RsvReservationSelector extends HTMLElement {
|
||||
const cal_el = document.createElement('div');
|
||||
cal_el.classList.add('rsv-calendar');
|
||||
|
||||
// Create rsv-timeline with timetable-id set before appending so
|
||||
// connectedCallback sees the correct attribute on first render.
|
||||
// Set up the calendar while cal_el is detached so the initial set_date()
|
||||
// change event fires on a disconnected node and cannot reach any listener.
|
||||
this._calendar = RsvCalendarPicker.create(cal_el, this.inputName);
|
||||
|
||||
// Set timetable-id and the initial date before connecting so connectedCallback
|
||||
// sees both attributes and renders the correct date on first attach.
|
||||
const time_el = document.createElement('rsv-timeline');
|
||||
time_el.setAttribute('timetable-id', this.timetableId);
|
||||
time_el.date = this._calendar.date;
|
||||
|
||||
this.append(cal_el, time_el);
|
||||
|
||||
this._calendar = RsvCalendarPicker.create(cal_el, this.inputName);
|
||||
|
||||
// Date change: clear selection, then push new date to the timeline element.
|
||||
cal_el.addEventListener('change', () => {
|
||||
this.querySelectorAll('.rsv-slots-slot-selected').forEach(s => s.classList.remove('rsv-slots-slot-selected'));
|
||||
|
||||
Reference in New Issue
Block a user