Authored by biao

fix size selection bug

... ... @@ -57,6 +57,7 @@ function setActive($item) {
var $colorList = $item.find('.color-list');
var $sizeList = $item.find('.size-list');
var activeIndex = 0;
$colorList.find('.img-box').each(function(i, box) {
var $box = $(box);
... ... @@ -64,10 +65,14 @@ function setActive($item) {
if ($box.find('img').data('color') === color) {
$colorList.find('.img-box').eq(i).addClass('active');
activeIndex = i;
return false;
}
});
$sizeList = $sizeList.eq(activeIndex).removeClass('hide');
$sizeList.find('span').each(function(i, s) {
var $size = $(s);
... ...
<div>
{{#goodsList}}
<div class="{{#unless @first}}hide{{/unless}} size-list" data-index="{{@index}}">
<div class="hide size-list" data-index="{{@index}}">
{{#sizeList}}
<span data-size="{{sizeName}}" data-sku="{{productSku}}" data-id="{{goodsId}}" {{#unless storageNumber}}class="disable"{{/unless}}>{{sizeName}}</span>
{{/sizeList}}
... ...