diff --git a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee index d1369fc393..5b92b28280 100644 --- a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee @@ -12,6 +12,11 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product $scope.supplied_properties = null $scope.showFilterSidebar = false + # Update filters after initial load of shop tab + $timeout => + $scope.update_filters() + + # Update filters when order cycle changed $rootScope.$on "orderCycleSelected", -> $scope.update_filters() $scope.clearAll() @@ -49,7 +54,6 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product $scope.$watch 'query', (newValue, oldValue) -> $scope.loadProducts() if newValue != oldValue $scope.$watchCollection 'activeTaxons', (newValue, oldValue) -> $scope.loadProducts() if newValue != oldValue $scope.$watchCollection 'activeProperties', (newValue, oldValue) -> $scope.loadProducts() if newValue != oldValue - $scope.$watch 'Products.loading', (newValue, oldValue) -> $scope.update_filters() if newValue == false && newValue != oldValue $scope.loadProducts = -> $scope.page = 1