Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Customer Addresses Page - Javascript errors #385

Closed
schaeken opened this issue Mar 31, 2015 · 0 comments · Fixed by #386
Closed

Customer Addresses Page - Javascript errors #385

schaeken opened this issue Mar 31, 2015 · 0 comments · Fixed by #386

Comments

@schaeken
Copy link
Contributor

A Javascript error occurs on the customer address page. The first issue happens when you have enough addresses that you start pagination on the page.

"Uncaught TypeError: Cannot read property 'addEventListener' of null"

http://snapify.shopify.com/31-17-rbkk5-x2rhz.jpg

This issue happens when you try to delete an address on a page that is paginated

"Uncaught TypeError: Cannot read property 'destroy' of undefined"

http://snapify.shopify.com/31-23-wq17f-b00yh.jpg

This had cause an issue when a theme developer used this theme as their base structure and was using javascript to scroll things.

They suggested this:

{% for address in customer.addresses %} 
new Shopify.CountryProvinceSelector('AddressCountry_{{ address.id }}', 'AddressProvince_{{ address.id }}', { 
hideElement: 'AddressProvinceContainer_{{ address.id }}'} 
); 
{% endfor %} 

Should be replaced with:

{% paginate customer.addresses by 5 %} {% for address in customer.addresses %} 
new Shopify.CountryProvinceSelector('AddressCountry_{{ address.id }}', 'AddressProvince_{{ address.id }}', { 
hideElement: 'AddressProvinceContainer_{{ address.id }}'} 
); 
{% endfor %}{% endpaginate %}

@cshold

@Shopify/design-gurus

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant