Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load amp social share only when we have icons to share. #968

Merged
merged 1 commit into from
Mar 20, 2017
Merged
Show file tree
Hide file tree
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
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