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.
This commit is contained in:
Maikel Linke
2016-04-08 09:33:09 +10:00
parent df5b554f24
commit 9e4610f9bd
2 changed files with 6 additions and 7 deletions

View File

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