uc_cart.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @file
  3. * Adds effects and behaviors to elements on the checkout page.
  4. */
  5. Drupal.behaviors.ucCart = {
  6. attach: function(context, settings) {
  7. // Add a throbber to the submit order button on the review order form.
  8. jQuery('form#uc-cart-checkout-review-form input#edit-submit:not(.ucSubmitOrderThrobber-processed)', context).addClass('ucSubmitOrderThrobber-processed').click(function() {
  9. jQuery(this).clone().insertAfter(this).attr('disabled', true).after('<span class="ubercart-throbber">&nbsp;&nbsp;&nbsp;&nbsp;</span>').end().hide();
  10. jQuery('#uc-cart-checkout-review-form #edit-back').attr('disabled', true);
  11. });
  12. }
  13. }
  14. /**
  15. * Behaviors for the Next buttons.
  16. *
  17. * When a customer clicks a Next button, expand the next pane, remove the
  18. * button, and don't let it collapse again.
  19. */
  20. function uc_cart_next_button_click(button, pane_id, current) {
  21. if (current !== 'false') {
  22. jQuery('#' + current + '-pane legend a').click();
  23. }
  24. else {
  25. button.disabled = true;
  26. }
  27. if (jQuery('#' + pane_id + '-pane').attr('class').indexOf('collapsed') > -1 && jQuery('#' + pane_id + '-pane').html() !== null) {
  28. jQuery('#' + pane_id + '-pane legend a').click();
  29. }
  30. return false;
  31. }