Sha256: e523acba8e03a691b810f70c0b64bd21c14424cbe59df1845a19c325654217cf

Contents?: true

Size: 1.05 KB

Versions: 312

Compression:

Stored size: 1.05 KB

Contents

Caboose.Store.Modules.CheckoutShipping = (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: { 
        invoice_package_id: $(event.target).data('invoice_package_id'),
        shipping_method_id: $(event.target).data('shipping_method_id'),
        total:              $(event.target).data('total')
      },
      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/gift-cards';        
      }
    });
    return false;
  };
    
  return self
}).call(Caboose.Store);

Version data entries

312 entries across 312 versions & 1 rubygems

Version Path
caboose-cms-0.9.229 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-1.0.2 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-1.0.1 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.228 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.227 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.226 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.225 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.224 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.223 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.222 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.221 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.220 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.219 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.218 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.217 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.216 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.215 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.214 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.213 app/assets/javascripts/caboose/checkout_shipping.js
caboose-cms-0.9.212 app/assets/javascripts/caboose/checkout_shipping.js