Skip to content

Commit a0363f5

Browse files
MAGETWO-67010: [Performance] Swatches real server side optimization
1 parent b300e72 commit a0363f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,9 @@ define([
945945
$widget.options.mediaCache[mediaCacheKey] = data;
946946
}
947947
$widget._ProductMediaCallback($this, data, productData.isInProductView);
948-
$widget._DisableProductMediaLoader($this);
948+
setTimeout(function() {
949+
$widget._DisableProductMediaLoader($this)
950+
}, 300);
949951
};
950952

951953
if (!$widget.options.mediaCallback) {
@@ -959,6 +961,7 @@ define([
959961

960962
if (mediaCacheKey in $widget.options.mediaCache) {
961963
$widget._XhrKiller();
964+
$widget._EnableProductMediaLoader($this);
962965
mediaSuccessCallback($widget.options.mediaCache[mediaCacheKey]);
963966
} else {
964967
mediaCallData.isAjax = true;

0 commit comments

Comments
 (0)