diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-05-06 15:22:04 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-05-06 15:22:04 +0200 |
| commit | a0a1eb402d84be81000ed608d3da40a495cc6d34 (patch) | |
| tree | eddd5d6c13005cd9ab6b2c8354573fa617e6de14 /StoneIsland/www/js/lib/cart/CartPayment.js | |
| parent | 9c18073017b5cc2334bf1867c004bfc74ba5a92a (diff) | |
cart accessibility
Diffstat (limited to 'StoneIsland/www/js/lib/cart/CartPayment.js')
| -rwxr-xr-x | StoneIsland/www/js/lib/cart/CartPayment.js | 17 |
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){ |
