Skip to content

Commit

Permalink
Feature detection upon checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
agektmr committed Apr 18, 2017
1 parent 52fa667 commit a9fa2f1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
bower_components
build
env
client_secrets.json
*.pyc
7 changes: 6 additions & 1 deletion src/shop-cart-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<a href="/cart" on-tap="close" id="viewCartAnchor">View Cart</a>
</shop-button>
<shop-button class="modal-button">
<a href="/checkout" on-tap="close">Checkout</a>
<button on-tap="_buyCart" type="button">Checkout</button>
</shop-button>
</div>

Expand Down Expand Up @@ -141,6 +141,11 @@
this.classList.remove('opened');
},

_buyCart: function() {
this.fire('buy-cart');
this.close();
},

_onCancel: function(e) {
// Don't restore focus when the overlay is closed after a mouse event
if (e.detail instanceof MouseEvent) {
Expand Down
5 changes: 4 additions & 1 deletion src/shop-cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h1>Your Cart</h1>
<div class="checkout-box">
Total: <span class="subtotal">[[_formatTotal(total)]]</span>
<shop-button responsive>
<a href="/checkout">Checkout</a>
<button on-tap="_buyCart" type="button">Checkout</button>
</shop-button>
</div>
</div>
Expand Down Expand Up @@ -89,7 +89,10 @@ <h1>Your Cart</h1>
type: Boolean,
computed: '_computeHasItem(cart.length)'
}
},

_buyCart: function() {
this.fire('buy-cart');
},

_formatTotal: function(total) {
Expand Down

0 comments on commit a9fa2f1

Please sign in to comment.