{I" class:ETI"ProcessedAsset;FI"logical_path;TI"spree/frontend/product.js;FI" pathname;TI"z/usr/local/rvm/gems/ruby-2.0.0-p481/gems/spree_frontend-2.2.4/app/assets/javascripts/spree/frontend/product.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;Tl+ʑTI" length;Tix I" digest;TI"%4f58f9221b59e240983d8d667065ab80;FI" source;TI"x (function() { $(function() { var radios, selectedRadio; Spree.addImageHandlers = function() { var thumbnails; thumbnails = $('#product-images ul.thumbnails'); ($('#main-image')).data('selectedThumb', ($('#main-image img')).attr('src')); thumbnails.find('li').eq(0).addClass('selected'); thumbnails.find('a').on('click', function(event) { ($('#main-image')).data('selectedThumb', ($(event.currentTarget)).attr('href')); ($('#main-image')).data('selectedThumbId', ($(event.currentTarget)).parent().attr('id')); ($(this)).mouseout(function() { thumbnails.find('li').removeClass('selected'); return ($(event.currentTarget)).parent('li').addClass('selected'); }); return false; }); thumbnails.find('li').on('mouseenter', function(event) { return ($('#main-image img')).attr('src', ($(event.currentTarget)).find('a').attr('href')); }); return thumbnails.find('li').on('mouseleave', function(event) { return ($('#main-image img')).attr('src', ($('#main-image')).data('selectedThumb')); }); }; Spree.showVariantImages = function(variantId) { var currentThumb, newImg, thumb; ($('li.vtmb')).hide(); ($('li.tmb-' + variantId)).show(); currentThumb = $('#' + ($('#main-image')).data('selectedThumbId')); if (!currentThumb.hasClass('vtmb-' + variantId)) { thumb = $(($('#product-images ul.thumbnails li:visible.vtmb')).eq(0)); if (!(thumb.length > 0)) { thumb = $(($('#product-images ul.thumbnails li:visible')).eq(0)); } newImg = thumb.find('a').attr('href'); ($('#product-images ul.thumbnails li')).removeClass('selected'); thumb.addClass('selected'); ($('#main-image img')).attr('src', newImg); ($('#main-image')).data('selectedThumb', newImg); return ($('#main-image')).data('selectedThumbId', thumb.attr('id')); } }; Spree.updateVariantPrice = function(variant) { var variantPrice; variantPrice = variant.data('price'); if (variantPrice) { return ($('.price.selling')).text(variantPrice); } }; radios = $('#product-variants input[type="radio"]'); if (radios.length > 0) { selectedRadio = $('#product-variants input[type="radio"][checked="checked"]'); Spree.showVariantImages(selectedRadio.attr('value')); Spree.updateVariantPrice(selectedRadio); } Spree.addImageHandlers(); return radios.click(function(event) { Spree.showVariantImages(this.value); return Spree.updateVariantPrice($(this)); }); }); }).call(this); ;TI"dependency_digest;TI"%a8275bff634c13f8452ceddcc4ba0e65;FI"required_paths;T[I"z/usr/local/rvm/gems/ruby-2.0.0-p481/gems/spree_frontend-2.2.4/app/assets/javascripts/spree/frontend/product.js.coffee;FI"dependency_paths;T[{I" path;TI"z/usr/local/rvm/gems/ruby-2.0.0-p481/gems/spree_frontend-2.2.4/app/assets/javascripts/spree/frontend/product.js.coffee;FI" mtime;TI"2014-09-04T12:22:34-04:00;TI" digest;TI"%4c0cb10a6178f2fe4289a179c4c612b7;FI" _version;TI"%5ef14a844324cba3e114bd0123f88a5e;F