Sha256: dc05888df088c2e9652c0fcc2cc572466bde76058239429edc3d969e8d51fd5d

Contents?: true

Size: 853 Bytes

Versions: 6

Compression:

Stored size: 853 Bytes

Contents

//= require spree/frontend

MercadoPago = {
  hidePaymentSaveAndContinueButton: function(paymentMethod) {
    if (MercadoPago.paymentMethodID && paymentMethod.val() == MercadoPago.paymentMethodID) {
      $('.continue').hide();
      $('[data-hook=coupon_code]').hide();
    } else {
      $('.continue').show();
      $('[data-hook=coupon_code]').show();
    }
  }
};

$(document).ready(function() {
  checkedPaymentMethod = $('div[data-hook="checkout_payment_step"] input[type="radio"]:checked');
  MercadoPago.hidePaymentSaveAndContinueButton(checkedPaymentMethod);
  paymentMethods = $('div[data-hook="checkout_payment_step"] input[type="radio"]').click(function (e) {
    MercadoPago.hidePaymentSaveAndContinueButton($(e.target));
  });

  $('button.mercado_pago_button').click(function(event){
    $(event.target).prop("disabled",true);
  });
});

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
solidus_mercado_pago-1.0.0 app/assets/javascripts/spree/frontend/solidus_mercado_pago.js
spree_mercado_pago-0.2.3 app/assets/javascripts/spree/frontend/spree_mercado_pago_payment_method.js
spree_mercado_pago-0.2.2 app/assets/javascripts/spree/frontend/spree_mercado_pago_payment_method.js
spree_mercado_pago-0.2.1 app/assets/javascripts/spree/frontend/spree_mercado_pago_payment_method.js
spree_mercado_pago-0.2.0 app/assets/javascripts/spree/frontend/spree_mercado_pago_payment_method.js
spree_mercado_pago_payment_method-0.2.0 app/assets/javascripts/spree/frontend/spree_mercado_pago_payment_method.js