Commit 9c8923a8 by liumengfei

Merge branch 'developer' into production

parents 46a7b746 6ea330bc
......@@ -543,34 +543,28 @@ define([
if (!this.hasOwnProperty('products') || this.products.length <= 0) {
attr += ' data-option-empty="true"';
}
var selectedStr = '';
if(index == 0)
{
selectedStr = ' selected';
}
if (type === 0) {
// Text
html += '<div class="' + optionClass + ' text' + selectedStr + '" ' + attr + '>' + (value ? value : label) +
html += '<div class="' + optionClass + ' text' + '" ' + attr + '>' + (value ? value : label) +
'</div>';
} else if (type === 1) {
// Color
html += '<div class="' + optionClass + ' color' + selectedStr + '" ' + attr +
html += '<div class="' + optionClass + ' color' + '" ' + attr +
' style="background: ' + value +
' no-repeat center; background-size: cover;">' + '' +
'</div>';
} else if (type === 2) {
// Image
html += '<div class="' + optionClass + ' image' + selectedStr + '" ' + attr +
html += '<div class="' + optionClass + ' image' + '" ' + attr +
' style="background: url(' + value + ') no-repeat center; background-size: cover;width:' +
swatchImageWidth + 'px; height:' + swatchImageHeight + 'px">' + '' +
'</div>';
} else if (type === 3) {
// Clear
html += '<div class="' + optionClass + selectedStr + '" ' + attr + '></div>';
html += '<div class="' + optionClass + '" ' + attr + '></div>';
} else {
// Default
html += '<div class="' + optionClass + selectedStr + '" ' + attr + '>' + label + '</div>';
html += '<div class="' + optionClass + '" ' + attr + '>' + label + '</div>';
}
});
......@@ -800,34 +794,30 @@ define([
if (!this.hasOwnProperty('products') || this.products.length <= 0) {
attr += ' data-option-empty="true"';
}
var selectedStr = '';
if(index == 0)
{
selectedStr = ' selected';
}
if (type === 0) {
// Text
html += '<div class="' + optionClass + ' text' + selectedStr + '" ' + attr + '>' + (value ? value : label) +
html += '<div class="' + optionClass + ' text' + '" ' + attr + '>' + (value ? value : label) +
'</div>';
} else if (type === 1) {
// Color
html += '<div class="' + optionClass + ' color' + selectedStr + '" ' + attr +
html += '<div class="' + optionClass + ' color' + '" ' + attr +
' style="background: ' + value +
' no-repeat center; background-size: cover;">' + '' +
'</div>';
} else if (type === 2) {
// Image
html += '<div class="' + optionClass + ' image' + selectedStr + '" ' + attr +
html += '<div class="' + optionClass + ' image' + '" ' + attr +
' style="background: url(' + value + ') no-repeat center; background-size: cover;width:' +
swatchImageWidth + 'px; height:' + swatchImageHeight + 'px">' + '' +
'</div>';
} else if (type === 3) {
// Clear
html += '<div class="' + optionClass + selectedStr + '" ' + attr + '></div>';
html += '<div class="' + optionClass + '" ' + attr + '></div>';
} else {
// Default
html += '<div class="' + optionClass + selectedStr + '" ' + attr + '>' + label + '</div>';
html += '<div class="' + optionClass + '" ' + attr + '>' + label + '</div>';
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment