Sha256: b19482aa2fb7507779817fc8d537328d96d27f4c764c601a2c194758dc5db4e6

Contents?: true

Size: 852 Bytes

Versions: 1

Compression:

Stored size: 852 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.mercadopago_button').click(function(event){
    $(event.target).prop("disabled",true);
  });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_mercadopago-1.0.0 app/assets/javascripts/spree/frontend/solidus_mercado_pago.js