Skip to content

Commit

Permalink
MAGETWO-88649: Wrong swatches behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
roman committed Oct 23, 2018
1 parent b67d77d commit 1ccf127
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinima
<?php if (isset($_formatedOptionValue['full_view'])): ?>
<?= /* @escapeNotVerified */ $_formatedOptionValue['full_view'] ?>
<?php else: ?>
<?= /* @escapeNotVerified */ $_formatedOptionValue['value'] ?>
<?= $block->escapeHtml($_formatedOptionValue['value'], ['span']) ?>
<?php endif; ?>
</dd>
<?php endforeach; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<span data-bind="html: option.value.join('<br>')"></span>
<!-- /ko -->
<!-- ko ifnot: Array.isArray(option.value) -->
<span data-bind="html: option.value"></span>
<span data-bind="text: option.value"></span>
<!-- /ko -->
</dd>
<!-- /ko -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<dd class="values" data-bind="html: full_view"></dd>
<!-- /ko -->
<!-- ko ifnot: ($data.full_view)-->
<dd class="values" data-bind="html: value"></dd>
<dd class="values" data-bind="text: value"></dd>
<!-- /ko -->
<!-- /ko -->
</dl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
define([
'underscore',
'uiRegistry',
'Magento_Ui/js/dynamic-rows/dynamic-rows'
], function (_, registry, dynamicRows) {
'Magento_Ui/js/dynamic-rows/dynamic-rows',
'jquery'
], function (_, registry, dynamicRows, $) {
'use strict';

return dynamicRows.extend({
Expand Down Expand Up @@ -217,6 +218,8 @@ define([

_.each(tmpData, function (row, index) {
path = this.dataScope + '.' + this.index + '.' + (this.startIndex + index);
row.attributes = $('<i></i>').text(row.attributes).html();
row.sku = $('<i></i>').text(row.sku).html();
this.source.set(path, row);
}, this);

Expand Down Expand Up @@ -401,8 +404,8 @@ define([
product = {
'id': row.productId,
'product_link': row.productUrl,
'name': row.name,
'sku': row.sku,
'name': $('<i></i>').text(row.name).html(),
'sku': $('<i></i>').text(row.sku).html(),
'status': row.status,
'price': row.price,
'price_currency': row.priceCurrency,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ define([
if ($widget.options.enableControlLabel) {
label +=
'<span id="' + controlLabelId + '" class="' + classes.attributeLabelClass + '">' +
item.label +
$('<i></i>').text(item.label).html() +
'</span>' +
'<span class="' + classes.attributeSelectedOptionLabelClass + '"></span>';
}

if ($widget.inProductList) {
$widget.productForm.append(input);
input = '';
listLabel = 'aria-label="' + item.label + '"';
listLabel = 'aria-label="' + $('<i></i>').text(item.label).html() + '"';
} else {
listLabel = 'aria-labelledby="' + controlLabelId + '"';
}
Expand Down Expand Up @@ -514,11 +514,12 @@ define([

id = this.id;
type = parseInt(optionConfig[id].type, 10);
value = optionConfig[id].hasOwnProperty('value') ? optionConfig[id].value : '';
value = optionConfig[id].hasOwnProperty('value') ?
$('<i></i>').text(optionConfig[id].value).html() : '';
thumb = optionConfig[id].hasOwnProperty('thumb') ? optionConfig[id].thumb : '';
width = _.has(sizeConfig, 'swatchThumb') ? sizeConfig.swatchThumb.width : 110;
height = _.has(sizeConfig, 'swatchThumb') ? sizeConfig.swatchThumb.height : 90;
label = this.label ? this.label : '';
label = this.label ? $('<i></i>').text(this.label).html() : '';
attr =
' id="' + controlId + '-item-' + id + '"' +
' aria-checked="false"' +
Expand Down Expand Up @@ -1159,7 +1160,6 @@ define([
updateBaseImage: function (images, context, isInProductView) {
var justAnImage = images[0],
initialImages = this.options.mediaGalleryInitial,
gallery = context.find(this.options.mediaGallerySelector).data('gallery'),
imagesToUpdate,
isInitial;

Expand Down

0 comments on commit 1ccf127

Please sign in to comment.