Sha256: 89ab10ba1f89514ff79b9fda71bda1702f37809dc3621bcc60b1519f6ef1e1a3

Contents?: true

Size: 1.53 KB

Versions: 57

Compression:

Stored size: 1.53 KB

Contents

var add_image_handlers = function() {
  $("#main-image").data('selectedThumb', $('#main-image img').attr('src'));
  $('ul.thumbnails li').eq(0).addClass('selected');
  $('ul.thumbnails li a').click(function() {
    $("#main-image").data('selectedThumb', $(this).attr('href'));
    $('ul.thumbnails li').removeClass('selected');
    $(this).parent('li').addClass('selected');
    return false;
  }).hover(
          function() {
            $('#main-image img').attr('src', $(this).attr('href').replace('mini', 'product'));
          },
          function() {
            $('#main-image img').attr('src', $("#main-image").data('selectedThumb'));
          }
          );
};
 
jQuery(document).ready(function() {
  add_image_handlers();
});
 
jQuery(document).ready(function() {
  jQuery('#product-variants input[type=radio]').click(function (event) {
    var vid = this.value;
    var text = $(this).siblings(".variant-description").html();
 
    jQuery("#variant-thumbnails").empty();
    jQuery("#variant-images span").html(text);
 
    if (images[vid].length > 0) {
      $.each(images[vid], function(i, link) {
        jQuery("#variant-thumbnails").append('<li>' + link + '</li>');
      });
 
      jQuery("#variant-images").show();
    } else {
      jQuery("#variant-images").hide();
    }
 
    add_image_handlers();
 
    var link = jQuery("#variant-thumbnails a")[0];
 
    jQuery("#main-image img").attr({src: jQuery(link).attr('href')});
    jQuery('ul.thumbnails li').removeClass('selected');
    jQuery(link).parent('li').addClass('selected');
  });
});

Version data entries

57 entries across 40 versions & 9 rubygems

Version Path
spree-0.11.4 vendor/extensions/theme_default/public/javascripts/product.js
apispree_core-0.0.0 public/javascripts/product.js
My-Commerce_core-1.1.0 public/javascripts/product.js
My-Commerce_core-1.0.0 public/javascripts/product.js
MyCommerceapi-1.0.0 api/spec/test_app/public/javascripts/product.js
MyCommerceapi-1.0.0 sandbox/public/javascripts/product.js
MyCommerceapi-1.0.0 dash/spec/test_app/public/javascripts/product.js
MyCommerceapi-1.0.0 promo/spec/test_app/public/javascripts/product.js
MyCommerceapi-1.0.0 core/public/javascripts/product.js
MyCommerceapi-1.0.0 auth/spec/test_app/public/javascripts/product.js
MyCommerceapi-1.0.0 core/spec/test_app/public/javascripts/product.js
MyCommerce-0.0.3 dash/spec/test_app/public/javascripts/product.js
MyCommerce-0.0.3 sandbox/public/javascripts/product.js
MyCommerce-0.0.3 auth/spec/test_app/public/javascripts/product.js
MyCommerce-0.0.3 promo/spec/test_app/public/javascripts/product.js
MyCommerce-0.0.3 core/spec/test_app/public/javascripts/product.js
MyCommerce-0.0.3 api/spec/test_app/public/javascripts/product.js
MyCommerce-0.0.3 core/public/javascripts/product.js
rfcommerce_sandbox-0.0.3 public/javascripts/product.js
rfcommerce_core-0.0.3 public/javascripts/product.js