Update SaveButton to be either an input or a button element, and restore inputs that were previously switched to buttons

This commit is contained in:
leigh-mil
2019-04-04 13:29:15 -04:00
parent 850153a517
commit f3ea704c1b
5 changed files with 10 additions and 8 deletions

View File

@@ -1,6 +1,8 @@
{% macro SaveButton(text, additional_classes="") -%}
{% macro SaveButton(text, element="button", additional_classes="", other_attrs="") -%}
{% set class = "usa-button usa-button-primary" + additional_classes %}
<button type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="!changed">
{{ text }}
</button>
<{{ element }} type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="!changed" value="{{ text }}" {{ other_attrs }}>
{% if element == 'button'%}
{{ text }}
{% endif %}
</{{ element }}>
{%- endmacro %}