Sha256: 975b7d4de09ff4f3888460c8f5e63b21ef023a2686f42ef40306827ae6ef6809

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

//= require jquery.ui.datepicker
$(document).ready(function() {
  $('#banktransfer_instructions').click(function(event) {
    newwindow = window.open($(this).attr('href'), 'bank transfer', 'left=20,top=20,width=650,height=750,toolbar=0,resizable=0,scrollbars=1');
    if (window.focus) {
      newwindow.focus();
    }
    return false;
  });

  $('[name="payment[deposited_on]"]').datepicker({dateFormat: '<%= Spree.t(:js_format, :scope => "date_picker", :default => "yy/mm/dd") %>'});

  $('.add_bt_details').click(function() {
    $(this).hide();
    $('.bt_payment_form').show();
  });

  $('.bt_payment_form input[type="submit"]').click(function(event) {
    var empty_fields = $('.required_field').filter(function() { return !$(this).val().trim().length }), empty_fields_names = []
    if ($(empty_fields).length) {
      $(empty_fields).each(function() {
        empty_fields_names.push($(this).attr('field-name'));
      });

      alert(empty_fields_names.join(', ') + " can't be blank");
      event.preventDefault();
      return false;
    }
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree-bank-transfer-2.3.0 app/assets/javascripts/store/spree_bank_transfer.js.erb
spree-bank-transfer-2.2.5 app/assets/javascripts/store/spree_bank_transfer.js.erb