fix: add form padding, validators for /configure pages
This commit is contained in:
parent
cadd63e3e8
commit
e9d59062ca
|
@ -9,7 +9,9 @@
|
|||
|
||||
${h.form(request.current_route_url(), enctype='multipart/form-data', ref='saveSettingsForm', **{'@submit': 'saveSettingsFormSubmit'})}
|
||||
${h.csrf_token(request)}
|
||||
<div class="wutta-form-wrapper">
|
||||
${self.form_content()}
|
||||
</div>
|
||||
${h.end_form()}
|
||||
|
||||
<b-modal has-modal-card
|
||||
|
@ -148,8 +150,18 @@
|
|||
ThisPageData.settingsNeedSaved = false
|
||||
ThisPageData.undoChanges = false
|
||||
ThisPageData.savingSettings = false
|
||||
ThisPageData.validators = []
|
||||
|
||||
ThisPage.methods.saveSettings = function() {
|
||||
|
||||
for (let validator of this.validators) {
|
||||
let msg = validator.call(this)
|
||||
if (msg) {
|
||||
alert(msg)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.savingSettings = true
|
||||
this.$refs.saveSettingsForm.submit()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue