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

Commit

Permalink
Merge pull request #517 from Shopify/cart-drawer
Browse files Browse the repository at this point in the history
Disable cart drawer when setting is page
  • Loading branch information
cshold committed Mar 15, 2016
2 parents 91fd07e + e4b63ec commit 1268e4f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
8 changes: 5 additions & 3 deletions assets/timber.js.liquid
Expand Up @@ -183,9 +183,11 @@ timber.accessibleNav = function () {

timber.drawersInit = function () {
timber.LeftDrawer = new timber.Drawers('NavDrawer', 'left');
timber.RightDrawer = new timber.Drawers('CartDrawer', 'right', {
{% if settings.ajax_cart_method == "drawer" %}'onDrawerOpen': ajaxCart.load{% endif %}
});
{% if settings.ajax_cart_method == "drawer" %}
timber.RightDrawer = new timber.Drawers('CartDrawer', 'right', {
'onDrawerOpen': ajaxCart.load
});
{% endif %}
};

timber.mobileNavToggle = function () {
Expand Down
28 changes: 15 additions & 13 deletions layout/theme.liquid
Expand Up @@ -132,18 +132,20 @@
</ul>
<!-- //mobile-nav -->
</div>
<div id="CartDrawer" class="drawer drawer--right">
<div class="drawer__header">
<div class="drawer__title h3">{{ 'cart.general.title' | t }}</div>
<div class="drawer__close js-drawer-close">
<button type="button" class="icon-fallback-text">
<span class="icon icon-x" aria-hidden="true"></span>
<span class="fallback-text">{{ 'cart.general.close_cart' | t | json }}</span>
</button>
{% if settings.ajax_cart_method == "drawer" %}
<div id="CartDrawer" class="drawer drawer--right">
<div class="drawer__header">
<div class="drawer__title h3">{{ 'cart.general.title' | t }}</div>
<div class="drawer__close js-drawer-close">
<button type="button" class="icon-fallback-text">
<span class="icon icon-x" aria-hidden="true"></span>
<span class="fallback-text">{{ 'cart.general.close_cart' | t | json }}</span>
</button>
</div>
</div>
<div id="CartContainer"></div>
</div>
<div id="CartContainer"></div>
</div>
{% endif %}
<div id="PageContainer" class="is-moved-by-drawer">
<header class="site-header" role="banner">
<div class="wrapper">
Expand Down Expand Up @@ -327,9 +329,9 @@
Use the link below to find your MailChimp form action
and insert it in your site settings.
If the form action URL is not set in the theme settings,
If the form action URL is not set in the theme settings,
it will fallback to a customer form so you can still capture the email.
MailChimp newsletter integration and requirement:
- http://docs.shopify.com/support/configuration/store-customization/where-do-i-get-my-mailchimp-form-action
{% endcomment %}
Expand Down Expand Up @@ -357,7 +359,7 @@
{% endif %}
{% endform %}
{% endif %}

</div>
{% endif %}
<div class="grid__item text-center">
Expand Down

0 comments on commit 1268e4f

Please sign in to comment.