Skip to content

Commit

Permalink
Merge pull request #143 from kevinsproles/master
Browse files Browse the repository at this point in the history
hotfix - fixed method build
  • Loading branch information
hippee-lee committed Sep 5, 2014
2 parents 74e775e + 4702a2e commit e7a405b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 2 additions & 10 deletions app/scripts/controllers/home.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
angular.module('Volusion.controllers')
.controller('HomeCtrl', ['$scope', '$filter', 'vnApi', 'vnImagePreloader',
function($scope, $filter, vnApi, vnImagePreloader) {
.controller('HomeCtrl', ['$scope', '$filter', 'vnApi',
function($scope, $filter, vnApi) {

'use strict';

var imagesToPreload = [];

angular.forEach($scope.themeSettings.pages.home.slider.slides, function (slide) {
imagesToPreload.push(slide.imageUrl);
});

vnImagePreloader.preloadImages(imagesToPreload);

vnApi.Product().get({ filter: 'featured', pageSize: 4 }).$promise
.then(function(response) {
$scope.featuredProducts = response.data;
Expand Down
12 changes: 10 additions & 2 deletions app/scripts/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Controller of the methodApp
*/
angular.module('Volusion.controllers')
.controller('MainCtrl', ['$scope', '$rootScope', '$location', '$window', '$timeout', 'vnApi', 'themeSettings', 'SiteConfig',
function ($scope, $rootScope, $location, $window, $timeout, vnApi, themeSettings, SiteConfig) {
.controller('MainCtrl', ['$scope', '$rootScope', '$location', '$window', '$timeout', 'vnApi', 'themeSettings', 'SiteConfig', 'vnImagePreloader',
function ($scope, $rootScope, $location, $window, $timeout, vnApi, themeSettings, SiteConfig, vnImagePreloader) {

// Handle the setup data
SiteConfig.getConfig().then(function(response) {
Expand All @@ -18,6 +18,14 @@ angular.module('Volusion.controllers')

themeSettings.getThemeSettings().then(function(response) {
$scope.themeSettings = response;

var imagesToPreload = [];

angular.forEach($scope.themeSettings.pages.home.slider.slides, function (slide) {
imagesToPreload.push(slide.imageUrl);
});

vnImagePreloader.preloadImages(imagesToPreload);
});

// Smart Nav *********************************************************
Expand Down

0 comments on commit e7a405b

Please sign in to comment.