Elkfox/shopify-theme-framework

Popups not initialized on addresses template

Closed this issue · 3 comments

The popup script is currently written as the one below.

So unless the form had a submission error the popup wont ever get initialized. There needs to be an else statement for the 3 popups on the page.

            {% if form.errors %}
              <script>
                $(document).ready(function() {
                  var AddressPopup_{{ address.id }} = new Focus('#PopupAddress_{{ address.id }}');
                  AddressPopup_{{ address.id }}.show();
                });
              </script>
            {% endif %}
          {% endform %}

I was using a copy of Concrete from a month ago so not sure if it was fixed since then.
This is the error in the console that I get

TypeError: n is undefined [Learn More] vendor.js:63:652 Focus.eventHandler https://cdn.shopify.com/s/files/1/2438/9053/t/1/assets/vendor.js:63:652 <anonymous> https://cdn.shopify.com/s/files/1/2438/9053/t/1/assets/vendor.js:63:1929 dispatch https://cdn.shopify.com/s/files/1/2438/9053/t/1/assets/vendor.js:11:16792 add/g.handle https://cdn.shopify.com/s/files/1/2438/9053/t/1/assets/vendor.js:11:14902

Theres another developer here using a more recent version from the past 2 weeks and it seems fine on his copy.

Cam commented

Thanks for reporting @jmathew1991. @ButsAndCats anything that immediately stands out to you here?

Addressed in latest release (2.0.3)