Skip to content

Commit

Permalink
Load amp social JS only when share icons are enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
junedkazi committed Mar 16, 2017
1 parent 8209ce3 commit aafee6b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Load amp social share JS only when we have share icons enabled. [#968](https://github.com/bigcommerce/cornerstone/pull/968)

## 1.6.2 (2017-03-15)
- Fix a bug that was not updating price and weight when an option is selected [#963](https://github.com/bigcommerce/cornerstone/pull/963)
Expand Down
14 changes: 8 additions & 6 deletions templates/components/amp/products/product-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ <h4 class="productAccordion-title">Description</h4>
{{#if settings.show_product_reviews}}
{{> components/amp/products/reviews reviews=product.reviews product=product urls=urls}}
{{/if}}
<section expanded class="productAccordion">
<h4 class="productAccordion-title">Share</h4>
<div class="productAccordion-content social-share">
{{> components/amp/common/share }}
</div>
</section>
{{#if settings.add_this.buttons}}
<section expanded class="productAccordion">
<h4 class="productAccordion-title">Share</h4>
<div class="productAccordion-content social-share">
{{> components/amp/common/share }}
</div>
</section>
{{/if}}
</amp-accordion>
</div>
6 changes: 4 additions & 2 deletions templates/pages/amp/product.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
{{#partial "amp-scripts"}}
<script async custom-element="amp-accordion" src="https://cdn.ampproject.org/v0/amp-accordion-0.1.js"></script>
<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
{{#if settings.add_this.buttons}}
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
{{/if}}
{{#if product.options}}
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
{{/if}}
{{#if product.videos}}
<script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script>
Expand Down

0 comments on commit aafee6b

Please sign in to comment.