Authored by xuqi

cur sizes

... ... @@ -401,6 +401,7 @@ Cart = {
success: function(res) {
var sizeIdx;
var curColor;
var curSize;
var hasActiveColor = false;
// 没有res.code
... ... @@ -433,9 +434,10 @@ Cart = {
defaultImg = curColor.pic;
}
for (sizeIdx = 0; sizeIdx < curColor.length; sizeIdx++) {
if (curColor.hasActiveColor && curColor[sizeIdx].name === defaultSize) {
curColor[sizeIdx].sizeFocus = true;
curSize = curColor.sizes;
for (sizeIdx = 0; sizeIdx < curSize.length; sizeIdx++) {
if (curColor.hasActiveColor && curSize[sizeIdx].name === defaultSize) {
curSize[sizeIdx].sizeFocus = true;
break;
}
}
... ... @@ -456,14 +458,16 @@ Cart = {
defaultImg: defaultImg
}));
oldProductSku = editTarget.find('.current-sizes .current').attr('data-sku');
oldProductSku = editTarget.find('.current').attr('data-sku');
// rebind events(Tips依赖接口数据,so 不能delegate)
editTarget.find('#confirm').click(function(e) {
e.preventDefault();
newProductSku = editTarget.find('.current-sizes .active').attr('data-sku');
// 没有重新选择颜色-尺码,则不用重新请求显示
if (!newProductSku || newProductSku === oldProductSku) {
if (!oldProductSku || !newProductSku || newProductSku === oldProductSku) {
editTarget.find('.edit-color-size').remove();
return false;
}
... ... @@ -526,7 +530,6 @@ Cart = {
}
$(this).addClass('active').siblings('.active').removeClass('active');
newProductSku = $(this).attr('data-sku');
});
// 初始化size list选中项(其他颜色中第一个尺码)
... ...
... ... @@ -97,8 +97,8 @@ $hoverColor: #379ed6;
line-height: 50px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-overflow: ellipsis !important;
white-space: nowrap !important;
max-width: 300px;
}
... ...