Skip to content

Commit d432abd

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-59789' into EPAM-PR-23
2 parents 12a4538 + 1beb99d commit d432abd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,9 @@ define([
501501
label,
502502
width,
503503
height,
504-
attr;
504+
attr,
505+
swatchImageWidth,
506+
swatchImageHeight;
505507

506508
if (!optionConfig.hasOwnProperty(this.id)) {
507509
return '';
@@ -534,6 +536,9 @@ define([
534536
' thumb-width="' + width + '"' +
535537
' thumb-height="' + height + '"';
536538

539+
swatchImageWidth = _.has(sizeConfig, 'swatchImage') ? sizeConfig.swatchImage.width : 30;
540+
swatchImageHeight = _.has(sizeConfig, 'swatchImage') ? sizeConfig.swatchImage.height : 20;
541+
537542
if (!this.hasOwnProperty('products') || this.products.length <= 0) {
538543
attr += ' option-empty="true"';
539544
}
@@ -552,7 +557,7 @@ define([
552557
// Image
553558
html += '<div class="' + optionClass + ' image" ' + attr +
554559
' style="background: url(' + value + ') no-repeat center; background-size: initial;width:' +
555-
sizeConfig.swatchImage.width + 'px; height:' + sizeConfig.swatchImage.height + 'px">' + '' +
560+
swatchImageWidth + 'px; height:' + swatchImageHeight + 'px">' + '' +
556561
'</div>';
557562
} else if (type === 3) {
558563
// Clear

0 commit comments

Comments
 (0)