Refactor SaveButton
This commit is contained in:
parent
5aae1691a2
commit
5e77c4f29c
@ -1,8 +1,10 @@
|
|||||||
{% macro SaveButton(text, element="button", additional_classes="", other_attrs="") -%}
|
{% macro SaveButton(text, element="button", additional_classes="", form=None) -%}
|
||||||
{% set class = "usa-button usa-button-primary" + additional_classes %}
|
{% set class = "usa-button usa-button-primary" + additional_classes %}
|
||||||
<{{ element }} type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="!changed" value="{{ text }}" {{ other_attrs }}>
|
{% if element == "button" %}
|
||||||
{% if element == 'button'%}
|
<button type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="!changed" {{ form_attr }} >
|
||||||
{{ text }}
|
{{ text }}
|
||||||
{% endif %}
|
</button>
|
||||||
</{{ element }}>
|
{% elif element == 'input' %}
|
||||||
|
<input type="submit" class="{{ class }}" tabindex="0" v-bind:disabled="!changed" value="{{ text }}" {% if form %}form="{{ form }}"{% endif %} />
|
||||||
|
{% endif %}
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user