Commit 6c6ca67f authored by gergely-ujvari's avatar gergely-ujvari

Page search uses viewState.sort

Originally page search was not prepared for the sort viewState, now it is.
For this, the applySort() was refactored to use the rootScope instead of the scope and produces both the predicate for the viewer and for the page search

Fixes #1148
parent 9ededea9
...@@ -206,15 +206,19 @@ class App ...@@ -206,15 +206,19 @@ class App
return if $rootScope.viewState.sort is sort return if $rootScope.viewState.sort is sort
$rootScope.viewState.sort = sort $rootScope.viewState.sort = sort
$rootScope.showViewSort true, true $rootScope.showViewSort true, true
if sort == 'Newest' switch sort
$scope.predicate = 'updated' when 'Newest'
$scope.reverse = true $rootScope.predicate = 'updated'
if sort == 'Oldest' $rootScope.searchPredicate = 'message.updated'
$scope.predicate = 'updated' $rootScope.reverse = true
$scope.reverse = false when 'Oldest'
if sort == 'Location' $rootScope.predicate = 'updated'
$scope.predicate = 'target[0].selector[2].start' $rootScope.searchPredicate = 'message.updated'
$scope.reverse = false $rootScope.reverse = false
when 'Location'
$rootScope.predicate = 'target[0].selector[2].start'
$rootScope.searchPredicate = 'message.target[0].selector[2].start'
$rootScope.reverse = false
# Clean up the searchbar # Clean up the searchbar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment