1/** 2 * Intenso Theme Library 3 * http://itactica.com/intenso 4 * Copyright 2014-2015, ITACTICA 5 * http://getintenso.com/license 6 */ 7 8var ConfigurableSwatchesList = { 9 swatchesByProduct: {}, 10 11 init: function() 12 { 13 var that = this; 14 $j('.configurable-swatch-list li').each(function() { 15 that.initSwatch(this); 16 var $swatch = $j(this); 17 if ($swatch.hasClass('filter-match')) { 18 that.handleSwatchSelect($swatch); 19 } 20 }); 21 }, 22 23 initSwatch: function(swatch) 24 { 25 var that = this; 26 var $swatch = $j(swatch); 27 var productId; 28 if (productId = $swatch.data('product-id')) { 29 if (typeof(this.swatchesByProduct[productId]) == 'undefined') { 30 this.swatchesByProduct[productId] = []; 31 } 32 this.swatchesByProduct[productId].push($swatch); 33 34 $swatch.find('a').off().on('click', function() { 35 that.handleSwatchSelect($swatch); 36 return false; 37 }); 38 } 39 }, 40 41 handleSwatchSelect: function($swatch) 42 { 43 var productId = $swatch.data('product-id'); 44 var label; 45 if (label = $swatch.data('option-label')) { 46 ConfigurableMediaImages.swapListImageByOption(productId, label); 47 } 48 49 $j.each(this.swatchesByProduct[productId], function(key, $productSwatch) { 50 $productSwatch.removeClass('selected'); 51 }); 52 53 $swatch.addClass('selected'); 54 } 55} 56 57$j(document).on('configurable-media-images-init', function(){ 58 ConfigurableSwatchesList.init(); 59});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.