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
return if $rootScope.viewState.sort is sort
$rootScope.viewState.sort = sort
$rootScope.showViewSort true, true
if sort == 'Newest'
$scope.predicate = 'updated'
$scope.reverse = true
if sort == 'Oldest'
$scope.predicate = 'updated'
$scope.reverse = false
if sort == 'Location'
$scope.predicate = 'target[0].selector[2].start'
$scope.reverse = false
switch sort
when 'Newest'
$rootScope.predicate = 'updated'
$rootScope.searchPredicate = 'message.updated'
$rootScope.reverse = true
when 'Oldest'
$rootScope.predicate = 'updated'
$rootScope.searchPredicate = 'message.updated'
$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
......
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