diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/form_debounce_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/form_debounce_controller.js new file mode 100644 index 00000000..21474f25 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/form_debounce_controller.js @@ -0,0 +1,25 @@ +import { Controller } from '@hotwired/stimulus' + +export default class extends Controller { + + static targets = ['button'] + static classes = [ 'disabled' ] + static values = { + isSubmitting: Boolean, + submittingLabel: { type: String, default: 'wird versendet' } + } + + debounce(e) { + if (true === this.isSubmittingValue) { + e.preventDefault() + e.stopPropagation() + return false + } + this.isSubmittingValue = true + this.buttonTarget.innerText = this.submittingLabelValue + if (this.hasDisabledClass) { + this.buttonTarget.classList.add(this.disabledClass) + } + } +} + diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Form/Form/Navigation.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Form/Form/Navigation.html index 6436f012..4b8ec61a 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Form/Form/Navigation.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Form/Form/Navigation.html @@ -7,10 +7,18 @@ - {formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'nextButtonLabel')} + + {formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'nextButtonLabel')} + - + {formvh:translateElementProperty(element: form, renderingOptionProperty: 'submitButtonLabel')} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/Form.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/Form.html new file mode 100644 index 00000000..ef9d15c4 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/Form.html @@ -0,0 +1,22 @@ + + + + +
+ +
+
+
+