Skip to content

Commit

Permalink
Revert "JS-337: [Configurable.JS] Preload all needed images"
Browse files Browse the repository at this point in the history
This reverts commit f213258.
  • Loading branch information
ValeryYafremau committed Dec 10, 2015
1 parent 296d777 commit 210289c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ define([
'jquery',
'underscore',
'mage/template',
'mage/gallery/preloadImages',
'priceUtils',
'priceBox',
'jquery/ui',
'jquery/jquery.parsequery'
], function ($, _, mageTemplate, preloadImages) {
], function ($, _, mageTemplate) {
'use strict';

$.widget('mage.configurable', {
Expand All @@ -39,10 +38,6 @@ define([
// Initial setting of various option values
this._initializeOptions();

//Preload all gallery images
this._preloadImages();
this._preloadOptionalImages();

// Override defaults with URL query parameters and/or inputs values
this._overrideDefaults();

Expand Down Expand Up @@ -92,43 +87,6 @@ define([
});
},

/**
* Preloads default configuration images.
* @private
*/
_preloadImages: function () {
var options = this.options,
fullImagesList = [],
imagesList = [];

_.each(options.mediaGalleryInitial, function (item) {
imagesList.push(item.img);
fullImagesList.push(item.full);
});
preloadImages(imagesList);
preloadImages(fullImagesList);
},

/**
* Preloads optional configuration images.
* @private
*/
_preloadOptionalImages: function () {
var options = this.options;

_.each(options.spConfig.images, function (array) {
var fullImagesList = [],
imagesList = [];

_.each(array, function (item) {
imagesList.push(item.img);
fullImagesList.push(item.full);
});
preloadImages(imagesList);
preloadImages(fullImagesList);
}
},

/**
* Override default options values settings with either URL query parameters or
* initialized inputs values.
Expand Down
35 changes: 0 additions & 35 deletions lib/web/mage/gallery/preloadImages.js

This file was deleted.

0 comments on commit 210289c

Please sign in to comment.