mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-25 05:45:15 +00:00
Add a clear filters button
- This button clear all stored filters and then update results
This commit is contained in:
@@ -30,6 +30,11 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
|
||||
completed_at_not_null: true
|
||||
}
|
||||
|
||||
$scope.clearFilters = () ->
|
||||
QueryPersistence.clearFilters()
|
||||
$scope.setDefaults()
|
||||
$scope.fetchResults()
|
||||
|
||||
$scope.fetchResults = (page=1) ->
|
||||
startDateWithTime = $scope.appendStringIfNotEmpty($scope.q?.completed_at_gteq, ' 00:00:00')
|
||||
endDateWithTime = $scope.appendStringIfNotEmpty($scope.q?.completed_at_lteq, ' 23:59:59')
|
||||
|
||||
@@ -25,3 +25,6 @@ angular.module("admin.indexUtils").factory 'QueryPersistence', (localStorageServ
|
||||
return true
|
||||
|
||||
false
|
||||
|
||||
clearFilters: () ->
|
||||
localStorageService.remove(@storageKey)
|
||||
|
||||
Reference in New Issue
Block a user