Refactor all Buefy form submit buttons, per Chrome behavior

ugh, what a pain.  and turns out i'd previously ran into this same issue for
jQuery, per commit e945ebe325
This commit is contained in:
Lance Edgar 2019-06-25 20:32:49 -05:00
parent 43a210cac4
commit a4b27115ac
17 changed files with 517 additions and 319 deletions

View file

@ -44,10 +44,11 @@
<div class="buttons">
## TODO: deprecate / remove the latter option here
% if form.auto_disable_save or form.auto_disable:
<once-button type="is-primary"
native-type="submit"
text="${getattr(form, 'submit_label', getattr(form, 'save_label', "Submit"))}">
</once-button>
<b-button type="is-primary"
native-type="submit"
:disabled="${form.component_studly}Submitting">
{{ ${form.component_studly}ButtonText }}
</b-button>
% else:
<b-button type="is-primary"
native-type="submit">
@ -83,6 +84,20 @@
<script type="text/javascript">
let ${form.component_studly} = {
template: '#${form.component}-template',
methods: {
## TODO: deprecate / remove the latter option here
% if form.auto_disable_save or form.auto_disable:
submit${form.component_studly}() {
this.${form.component_studly}Submitting = true
this.${form.component_studly}ButtonText = "Working, please wait..."
}
% endif
}
}
let ${form.component_studly}Data = {
## TODO: ugh, this seems pretty hacky. need to declare some data models
@ -95,6 +110,12 @@
% endif
% endfor
% endif
## TODO: deprecate / remove the latter option here
% if form.auto_disable_save or form.auto_disable:
${form.component_studly}Submitting: false,
${form.component_studly}ButtonText: ${json.dumps(getattr(form, 'submit_label', getattr(form, 'save_label', "Submit")))|n},
% endif
}
</script>