summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/cart/CartPayment.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-29 12:38:30 -0500
committerJules Laplace <jules@okfoc.us>2015-11-29 12:38:30 -0500
commit532ed5f1a16fad3c2dfc7980c163083f21a60fbc (patch)
treee977cc9f3d73b19fc1d8862bb7fb77bc70e24a16 /StoneIsland/www/js/lib/cart/CartPayment.js
parent72ba42fce0c81601ec8ea5e544f35de1fdbf708d (diff)
cart billing/confirm html
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartPayment.js')
-rw-r--r--StoneIsland/www/js/lib/cart/CartPayment.js29
1 files changed, 28 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/cart/CartPayment.js b/StoneIsland/www/js/lib/cart/CartPayment.js
index 8412f35d..90fe4a76 100644
--- a/StoneIsland/www/js/lib/cart/CartPayment.js
+++ b/StoneIsland/www/js/lib/cart/CartPayment.js
@@ -2,16 +2,26 @@ var CartPayment = FormView.extend({
el: "#cart_payment",
+ action: sdk.cart.set_credit_card,
+
events: {
+ "change [name=same_as_shipping]": "toggle_shipping",
+ "click .dropdown-wrapper": "toggle_dropdown",
},
initialize: function(opt){
this.parent = opt.parent
this.$form = this.$("form")
this.$msg = this.$(".msg")
+ this.$address_list = this.$(".address_list")
+ this.$address_form = this.$(".address")
+ this.$cc_form = this.$(".cc")
+
this.address = new AddressView ({ parent: this, checkPhone: false })
this.cc = new CreditCardView ({ parent: this })
this.scroller = new IScroll('#cart_payment', app.iscroll_options)
+ this.address.disabled = true
+ this.cc.disabled = true
},
// sdk.cart.set_credit_card
@@ -27,12 +37,29 @@ var CartPayment = FormView.extend({
app.footer.show("CONFIRM &gt;", "CANCEL")
window.location.hash = "#/cart/payment"
+ this.populate()
this.deferScrollToTop()
+ },
+
+ toggle_dropdown: function(state){
+ if (! app.account.ccs.length) {
+ state = false
+ }
+ this.list_mode = typeof state == "boolean" ? state : ! this.list_mode
+ this.address.disabled = this.list_mode
+ this.$address_form.toggle(! this.list_mode)
+ this.$cc_form.toggle(! this.list_mode)
+ this.$address_list.toggle(this.list_mode)
+ },
- sdk.cart.set_payment_type({ data: payment_id })
+ populate: function(){
+ app.account.ccs.forEach(function(cc){
+ })
},
save: function(){
+ // use stored credit card
+ return
},
cancel: function(){