summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/cart/CartPayment.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartPayment.js')
-rwxr-xr-xStoneIsland/www/js/lib/cart/CartPayment.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/StoneIsland/www/js/lib/cart/CartPayment.js b/StoneIsland/www/js/lib/cart/CartPayment.js
index 40d08d9e..0e4c3b84 100755
--- a/StoneIsland/www/js/lib/cart/CartPayment.js
+++ b/StoneIsland/www/js/lib/cart/CartPayment.js
@@ -73,6 +73,10 @@ var CartPayment = FormView.extend({
this.address.disabled = this.address_list_mode
this.$address_form.toggle(! this.address_list_mode)
this.$address_list.toggle(this.address_list_mode)
+ this.scroller.refresh()
+ this.$("input,select").map(function(i) {
+ this.setAttribute('tabindex', i+1)
+ })
},
toggle_cc: function(state){
@@ -86,6 +90,10 @@ var CartPayment = FormView.extend({
this.$cc_form.toggle(! this.cc_list_mode)
this.$cc_list.toggle(this.cc_list_mode)
this.$cc_confirm.toggle(this.cc_list_mode)
+ this.scroller.refresh()
+ this.$("input,select").map(function(i) {
+ this.setAttribute('tabindex', i+1)
+ })
},
focus_on_cc: function(e){
@@ -104,8 +112,8 @@ var CartPayment = FormView.extend({
this.toggle_address( !! app.account.ccs.length )
this.toggle_cc( !! app.account.ccs.length )
- app.account.ccs.forEach(function(cc){
- var address_t = this.address_template.replace(/{{id}}/g, cc.Id)
+ app.account.ccs.forEach(function(cc, i){
+ var address_t = this.address_template.replace(/{{id}}/g, (cc.Id || i))
.replace(/{{checked}}/g, cc.IsDefault ? "checked" : "")
.replace(/{{name}}/g, (cc.Name + " " + cc.Surname).toUpperCase())
.replace(/{{address}}/g, cc.Address.replace(/\n$/,"").replace("\n", ", "))
@@ -113,7 +121,7 @@ var CartPayment = FormView.extend({
.replace(/{{state}}/g, cc.Province)
.replace(/{{zip}}/g, cc.ZipCode)
- var cc_t = this.cc_template.replace(/{{id}}/g, cc.Id)
+ var cc_t = this.cc_template.replace(/{{id}}/g, (cc.Id || i))
.replace(/{{checked}}/g, cc.IsDefault ? "checked" : "")
.replace(/{{number}}/g, cc['Number'])
.replace(/{{type}}/g, cc.Type.toUpperCase())
@@ -122,6 +130,9 @@ var CartPayment = FormView.extend({
this.$address_list.append(address_t)
this.$cc_list.append(cc_t)
}.bind(this))
+ this.$("input,select").map(function(i) {
+ this.setAttribute('tabindex', i+1)
+ })
},
finalize: function(data){