diff --git a/assets/eventregistration.js b/assets/eventregistration.js index af07bcf..8fa3a4a 100644 --- a/assets/eventregistration.js +++ b/assets/eventregistration.js @@ -23,7 +23,7 @@ export default function (toasted) { gender: 'Weiblich', email: 'philipp@aaa.de', birthday: '1991-06-20', - agegroup: '', + agegroup: 'Leiter', group: '', agegroup_leader: '', emergency_phone: '', @@ -35,7 +35,7 @@ export default function (toasted) { meta: { submitRequest: null, errorFields: [], - active: 0, + active: 2, slides: [ 'Persönliches', 'Veranstaltung', @@ -88,25 +88,18 @@ export default function (toasted) { if (e !== null) { e.preventDefault(); } + if (index < 0 || index > this.meta.slides.length-1) { + return; + } this.scrollForm(this.$refs.form); this.meta.active = index; this.$refs.slider.scrollLeft = this.$refs.slider.scrollWidth / this.meta.slides.length * index; - // this.$refs.mobileSlider.scrollLeft = this.$refs.mobileSlider.scrollWidth / this.meta.slides.length * index; + this.$refs.mobileSlider.scrollLeft = this.$refs.mobileSlider.scrollWidth / this.meta.slides.length * index; }, scrollForm(el) { var margin = window.getComputedStyle(el).marginTop.replace('px', ''); scrollToElement(el, 300, (margin?margin:0) * -1); }, - onNextButtonClick(e) { - if (this.meta.active != this.meta.slides.length - 1) { - this.slideTo(e, this.meta.active + 1); - } - }, - onPrevButtonClick(e) { - if (this.meta.active != 0) { - this.slideTo(e, this.meta.active - 1); - } - }, submit() { var _self = this; var promise = fetch(window.location.href, { diff --git a/components/eventform/default.htm b/components/eventform/default.htm index 7a70b44..b5a53ac 100644 --- a/components/eventform/default.htm +++ b/components/eventform/default.htm @@ -4,33 +4,33 @@ {% macro field(context, name, label, required, type) %} {% endmacro %} {% macro textarea(context, name, label, required, type) %} {% endmacro %} {% macro select(context, name, label, required, options) %} @@ -41,7 +41,7 @@ class="text-gray-600 text-sm" >{{label}} {% if required %} * {% endif %} -