mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-26 05:55:15 +00:00
Can remove filters from BPE
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user