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_core-0.60.6 public/javascripts/product.js
spree_core-0.60.5 public/javascripts/product.js
spree-0.11.3 vendor/extensions/theme_default/public/javascripts/product.js
spree_core-0.30.2 public/javascripts/product.js
spree_core-0.40.4 public/javascripts/product.js
spree_core-0.50.4 public/javascripts/product.js
spree_core-0.60.4 public/javascripts/product.js
spree_core-0.50.3 public/javascripts/product.js
spree_core-0.60.3 public/javascripts/product.js
spree_core-0.60.2 public/javascripts/product.js
spree_core-0.60.1 public/javascripts/product.js
spree_core-0.60.0 public/javascripts/product.js
spree_core-0.60.0.RC1 public/javascripts/product.js
spree_essential_press-0.1.0.pre3 test/dummy/public/javascripts/product.js
spree_essential_press-0.1.0.pre2 test/dummy/public/javascripts/product.js
spree_core-0.50.2 public/javascripts/product.js
spree_core-0.50.1 public/javascripts/product.js
spree_core-0.50.0 public/javascripts/product.js
spree_core-0.40.3 public/javascripts/product.js
spree_core-0.40.2 public/javascripts/product.js