Sha256: 7b59eef8296a9502f826ec2c9ef826a83fcc920860c8fd39d054ddc1dff1e6d5

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

Caboose.Store.Modules.CheckoutStep3 = (function() {
    
  self = {};
   
  self.initialize = function() {                
    self.bind_event_handlers();
  };
  
  self.bind_event_handlers = function() {
    $('a.shipping_rate').click(self.shipping_click_handler);    
  };

  self.shipping_click_handler = function(event) {
    event.preventDefault();
    $('#message').html("<p class='loading'>Saving information...</p>");            
    $.ajax({
      url: '/checkout/shipping',
      type: 'put',      
      data: { 
        carrier:      $(event.target).data('carrier'),
        service_code: $(event.target).data('service-code'),
        service_name: $(event.target).data('service-name')         
      },
      success: function(resp) {
        if (resp.errors && resp.errors.length > 0)
          $('#message').html("<p class='note error'>" + resp.errors[0] + "</p>");
        else if (resp.success)
          window.location = '/checkout/step-four';        
      }
    });
    return false;
  };
    
  return self
}).call(Caboose.Store);

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
caboose-cms-0.5.69 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.68 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.67 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.66 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.64 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.63 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.62 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.61 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.60 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.59 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.58 app/assets/javascripts/caboose/checkout_step3.js
caboose-cms-0.5.57 app/assets/javascripts/caboose/checkout_step3.js