Can remove filters from BPE

This commit is contained in:
Rob H
2014-01-05 17:53:32 +08:00
parent fb9fd5089a
commit 2e56d7a551
4 changed files with 57 additions and 9 deletions

View File

@@ -165,7 +165,7 @@ productsApp.controller "AdminBulkProductsCtrl", [
$scope.$watch ->
$scope.totalPages()
, (newVal, oldVal) ->
$scope.currentPage = $scope.totalPages() if newVal != oldVal && $scope.totalPages() < $scope.currentPage
$scope.currentPage = Math.max $scope.totalPages(), 1 if newVal != oldVal && $scope.totalPages() < $scope.currentPage
$scope.initialise = (spree_api_key) ->
authorise_api_reponse = ""
@@ -252,6 +252,12 @@ productsApp.controller "AdminBulkProductsCtrl", [
$scope.currentFilters.push filter
$scope.fetchProducts()
$scope.removeFilter = (filter) ->
index = $scope.currentFilters.indexOf(filter)
if index != -1
$scope.currentFilters.splice index, 1
$scope.fetchProducts()
$scope.editWarn = (product, variant) ->
if ($scope.dirtyProductCount() > 0 and confirm("Unsaved changes will be lost. Continue anyway?")) or ($scope.dirtyProductCount() == 0)