Skip to content
This repository was archived by the owner on Aug 30, 2018. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions templates/customers/addresses.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
{% comment %}
Add address form, hidden by default
{% endcomment %}
<div id="AddAddress" class="form-vertical" style="display: none;">
{% form 'customer_address', customer.new_address %}

{% form 'customer_address', customer.new_address %}
<div id="AddAddress" class="form-vertical" {% unless form.errors %}style="display:none;"{% endunless %}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, with the form wrapped around this we'll always have the element visible on the page (though empty). I can't think of another way (without JS) so as long as this doesn't effect the layout, 👍

<h2>{{ 'customer.addresses.add_new' | t }}</h2>
{{ form.errors | default_errors }}

<div class="grid">

Expand Down Expand Up @@ -93,8 +93,8 @@
<p><a href="#" onclick="Shopify.CustomerAddress.toggleNewForm(); return false;">{{ 'customer.addresses.cancel' | t }}</a></p>

<hr>
{% endform %}
</div>
</div>
{% endform %}

<h2>{{ 'customer.addresses.title' | t }}</h2>

Expand Down Expand Up @@ -125,10 +125,10 @@
{{ 'customer.addresses.delete' | t | delete_customer_address_link: address.id }}
</p>

<div id="EditAddress_{{ address.id }}" class="form-vertical" style="display:none;">
{% form 'customer_address', address %}

{% form 'customer_address', address %}
<div id="EditAddress_{{ address.id }}" class="form-vertical" {% unless form.errors %}style="display:none;"{% endunless %}>
<h4>{{ 'customer.addresses.edit_address' | t }}</h4>
{{ form.errors | default_errors }}

<div class="grid">
<div class="grid__item one-half small--one-whole">
Expand Down Expand Up @@ -183,8 +183,8 @@
<p><a href="#" onclick="Shopify.CustomerAddress.toggleForm({{ form.id }}); return false;">{{ 'customer.addresses.cancel' | t }}</a></p>

<hr>
{% endform %}
</div>
</div>
{% endform %}

{% endfor %}

Expand Down