diff options
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/cart/CartPayment.js')
| -rwxr-xr-x | StoneIsland/platforms/android/assets/www/js/lib/cart/CartPayment.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/cart/CartPayment.js b/StoneIsland/platforms/android/assets/www/js/lib/cart/CartPayment.js index 31c371a5..3a9e6412 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/cart/CartPayment.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/cart/CartPayment.js @@ -15,6 +15,7 @@ var CartPayment = FormView.extend({ "change [name=SameAsShipping]": "toggle_shipping", "click .address_dropdown": "toggle_address", "click .cc_dropdown": "toggle_cc", + "focus [name=Number]": "focus_on_cc", }, initialize: function(opt){ @@ -34,6 +35,11 @@ var CartPayment = FormView.extend({ this.address = new AddressView ({ parent: this, checkPhone: false }) this.cc = new CreditCardView ({ parent: this }) this.scroller = new IScroll('#cart_payment', app.iscroll_options) + this.scroller.on('scrollStart', function(){ + if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'SELECT') { + document.activeElement.blur() + } + }) this.address.disabled = true this.cc.disabled = true }, @@ -63,7 +69,7 @@ var CartPayment = FormView.extend({ } // this.$address_dropdown.toggle( !! app.account.ccs.length ) - this.address_list_mode = typeof state == "boolean" ? state : ! this.list_mode + this.address_list_mode = typeof state == "boolean" ? state : ! this.address_list_mode this.address.disabled = this.address_list_mode this.$address_form.toggle(! this.address_list_mode) this.$address_list.toggle(this.address_list_mode) @@ -82,6 +88,15 @@ var CartPayment = FormView.extend({ this.$cc_confirm.toggle(this.cc_list_mode) }, + focus_on_cc: function(e){ + this.scroller.scrollToElement(e.currentTarget) + if (e.currentTarget.textShadow === '') { + e.currentTarget.textShadow = 'rgba(0,0,0,0) 0 0 0'; + } else { + e.currentTarget.textShadow = ''; + } + }, + populate: function(){ this.$(".save_as_default").show() this.$address_list.empty() |
