Files
openfoodnetwork/app/assets/javascripts/admin/customers/controllers/customers_controller.js.coffee
Maikel Linke 9e4610f9bd Customers: enable change of hub if no customers
Fix #588.

And show search bar even when no customers are shown. Previously, the
search bar disappeared when you entered a search without results.
2016-04-15 11:12:22 +10:00

18 lines
597 B
CoffeeScript

angular.module("admin.customers").controller "customersCtrl", ($scope, Customers, Columns, pendingChanges, shops) ->
$scope.shop = {}
$scope.shops = shops
$scope.submitAll = pendingChanges.submitAll
$scope.columns = Columns.setColumns
email: { name: "Email", visible: true }
code: { name: "Code", visible: true }
tags: { name: "Tags", visible: true }
$scope.$watch "shop.id", ->
if $scope.shop.id?
Customers.loaded = false
$scope.customers = Customers.index(enterprise_id: $scope.shop.id)
$scope.loaded = ->
Customers.loaded