Skip to content

Commit

Permalink
Merge pull request #968 from junedkazi/fix-amp-social
Browse files Browse the repository at this point in the history
Load amp social share only when we have icons to share.
  • Loading branch information
junedkazi authored Mar 20, 2017
2 parents 06e9af2 + 4cbdf79 commit 2074bc8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Draft
- `stencil.conf.js` was refactored to support webpack2 builds [961](https://github.com/bigcommerce/cornerstone/pull/961)
- 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 2074bc8

Please sign in to comment.