Skip to content

Commit

Permalink
#383421: allow multiple slot finder instances on one site (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
innerjoin authored May 16, 2024
1 parent 7825904 commit 18bb19d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Next
* Allow multiple slot finder instances on one site (#383421)

## [1.4.5] - 08.05.2024

Expand Down
31 changes: 16 additions & 15 deletions content-elements/base/slot-finder/prototype/slot-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,35 @@ import { initDayView, initWeekView } from "../src/slot/slot.js";
* @property {Observable<Slot|null>} selectedSlot
*/

/** @type {Model} */
const model = {
locale: '',
url: '',
selectedDate: Observable(new Date()),
slots: Observable([]),
selectedSlot: Observable(null),
};

Alpine.data('slotFinder', () => ({

/** @type {Model} */
model: {
locale: '',
url: '',
selectedDate: Observable(new Date()),
slots: Observable([]),
selectedSlot: Observable(null),
},

init() {
model.locale = document.documentElement.lang.slice(0, 2) ?? 'de';
model.url = this.$el.dataset.bsiUrl ?? '';
this.model.locale = document.documentElement.lang.slice(0, 2) ?? 'de';
this.model.url = this.$el.dataset.bsiUrl ?? '';
},

initCalendar() {
initCalendar(model, this.$el);
initCalendar(this.model, this.$el);
},

initDayView() {
initDayView(model, this.$el, this.$refs.noSlotsText, this.$refs.chooseAnotherDayText);
initDayView(this.model, this.$el, this.$refs.noSlotsText, this.$refs.chooseAnotherDayText);
},

initWeekView() {
initWeekView(model, this.$el, this.$refs.noSlotsText, this.$refs.chooseAnotherDayText);
initWeekView(this.model, this.$el, this.$refs.noSlotsText, this.$refs.chooseAnotherDayText);
},

initSummary() {
initSummary(model, this.$el, this.$refs.bookButton);
initSummary(this.model, this.$el, this.$refs.bookButton);
},
}));

0 comments on commit 18bb19d

Please sign in to comment.