Sha256: e5ee444092e84c785a9a0b16ef41bc5eddf3b07c1af973232f12769796cf8125

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

var subscribe_email_default_txt = '';

jQuery.ajaxSetup({
    'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
});

var SpreeMailchimpApp = {

  doSubmit: function(e) {
          SpreeMailchimpApp.getBusy(null); // could really use $.proxy here but spree doesn't have 1.4
          $.post(this.action+'.js', $(this).serialize(), SpreeMailchimpApp.getNotBusy, "script");
          return false;
  },

  getBusy : function( fn ) {
          $("body").css('cursor', 'progress');
          $("#busy_indicator").fadeIn('fast', fn);
  },

  getNotBusy : function() {
          $("body").css('cursor', 'default');
          $("#busy_indicator").fadeOut('fast');
  }

};



jQuery(document).ready( function() {

    subscribe_email_default_txt = $('#subscribe_email').val();

    $('#subscribe_email').bind('focus', function() {
      if (this.value == subscribe_email_default_txt) this.value = '';
    });
    $('#subscribe_email').bind('blur', function() {
      if (this.value == '') this.value = subscribe_email_default_txt;
    });

    $('#mailchimp_subscribe_wrap form').bind('submit', SpreeMailchimpApp.doSubmit);

});



Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_mail_chimp-3.0.2 app/assets/javascripts/store/mailchimp_subscribe.js
spree_mail_chimp-3.0.1 app/assets/javascripts/store/mailchimp_subscribe.js
spree_mail_chimp-3.0.0 app/assets/javascripts/store/mailchimp_subscribe.js