diff --git a/app/assets/javascripts/admin/order_cycles/controllers/incoming_controller.js.coffee b/app/assets/javascripts/admin/order_cycles/controllers/incoming_controller.js.coffee index dabf9d2bc5..e3bb5055f2 100644 --- a/app/assets/javascripts/admin/order_cycles/controllers/incoming_controller.js.coffee +++ b/app/assets/javascripts/admin/order_cycles/controllers/incoming_controller.js.coffee @@ -9,7 +9,7 @@ angular.module('admin.orderCycles').controller 'AdminOrderCycleIncomingCtrl', ($ enterprise = $scope.enterprises[exchange.enterprise_id] return enterprise.numVariants if enterprise.numVariants? - $scope.loadExchangeProducts($scope, exchange) + $scope.loadExchangeProducts(exchange) return unless enterprise.supplied_products? enterprise.numVariants = $scope.countVariants(enterprise.supplied_products) diff --git a/app/assets/javascripts/admin/order_cycles/controllers/order_cycle_exchanges_controller.js.coffee b/app/assets/javascripts/admin/order_cycles/controllers/order_cycle_exchanges_controller.js.coffee index b3e2690732..b52a7ae188 100644 --- a/app/assets/javascripts/admin/order_cycles/controllers/order_cycle_exchanges_controller.js.coffee +++ b/app/assets/javascripts/admin/order_cycles/controllers/order_cycle_exchanges_controller.js.coffee @@ -36,14 +36,14 @@ angular.module('admin.orderCycles') $scope.removeDistributionOfVariant = (variant_id) -> OrderCycle.removeDistributionOfVariant(variant_id) - $scope.loadExchangeProducts = (scope, exchange) -> - return if scope.enterprises[exchange.enterprise_id].supplied_products_fetched? - scope.enterprises[exchange.enterprise_id].supplied_products_fetched = true + $scope.loadExchangeProducts = (exchange) -> + return if $scope.enterprises[exchange.enterprise_id].supplied_products_fetched? + $scope.enterprises[exchange.enterprise_id].supplied_products_fetched = true incoming = true if $scope.view == 'incoming' params = { exchange_id: exchange.id, enterprise_id: exchange.enterprise_id, order_cycle_id: $scope.order_cycle.id, incoming: incoming} Product.index params, (products) -> - scope.enterprises[exchange.enterprise_id].supplied_products = products + $scope.enterprises[exchange.enterprise_id].supplied_products = products # Register listeners to capture first toggle open of the products panel of the exchange $scope.exchangeListChanged = -> @@ -57,5 +57,5 @@ angular.module('admin.orderCycles') $scope.initializeExchangeProductsPanel = (selection, $element) -> scope = $element.scope() return if $scope.exchangeProdutsPanelInitialized[scope.exchange.enterprise_id] - $scope.loadExchangeProducts(scope, scope.exchange) + $scope.loadExchangeProducts(scope.exchange) $scope.exchangeProdutsPanelInitialized[scope.exchange.enterprise_id] = true