Sha256: 553ae1aabd0e35d8af2cf80b5560a26794eac978e4f663f87e184953a0ff9189

Contents?: true

Size: 1.6 KB

Versions: 54

Compression:

Stored size: 1.6 KB

Contents

//= require jquery.payment
$(document).ready(function () {
  if ($('#new_payment').length) {
    $('.cardNumber').payment('formatCardNumber')
    $('.cardExpiry').payment('formatCardExpiry')
    $('.cardCode').payment('formatCardCVC')

    $('.cardNumber').change(function () {
      $('.ccType').val($.payment.cardType(this.value))
    })

    $('.payment_methods_radios').click(
      function () {
        $('.payment-methods').hide()
        $('.payment-methods :input').prop('disabled', true)
        if (this.checked) {
          $('#payment_method_' + this.value + ' :input').prop('disabled', false)
          $('#payment_method_' + this.value).show()
        }
      }
    )

    $('.payment_methods_radios').each(
      function () {
        if (this.checked) {
          $('#payment_method_' + this.value + ' :input').prop('disabled', false)
          $('#payment_method_' + this.value).show()
        } else {
          $('#payment_method_' + this.value).hide()
          $('#payment_method_' + this.value + ' :input').prop('disabled', true)
        }

        if ($('#card_new' + this.value).is('*')) {
          $('#card_new' + this.value).radioControlsVisibilityOfElement('#card_form' + this.value)
        }
      }
    )

    $('.cvvLink').click(function (event) {
      var windowName = 'cvv_info'
      var windowOptions = 'left=20,top=20,width=500,height=500,toolbar=0,resizable=0,scrollbars=1'
      window.open($(this).prop('href'), windowName, windowOptions)
      event.preventDefault()
    })

    $('select.jump_menu').change(function () {
      window.location = this.options[this.selectedIndex].value
    })
  }
})

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
spree_backend-4.0.9 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.1.15 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.1.14 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.0.8 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-3.7.14.1 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.1.13.1 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.0.7.1 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.0.7 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-3.7.14 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.1.13 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.0.6 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-3.7.13 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.0.5 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.1.12 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-3.7.12 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.0.4 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-3.7.11 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.1.11 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.1.10 app/assets/javascripts/spree/backend/payments/new.js
spree_backend-4.1.9 app/assets/javascripts/spree/backend/payments/new.js