Commit 9f9b4ab9 authored by gergely-ujvari's avatar gergely-ujvari

Merge pull request #1340 from hypothesis/1339-careful-location-search-sync

Be careful syncing $location.search and queries
parents 3a319177 b9d3ddad
......@@ -231,9 +231,6 @@ class App
$rootScope.$on '$routeChangeSuccess', (event, next, current) ->
unless next.$$route? then return
$scope.search.query = $location.search()
$scope.search.show = not angular.equals($location.search(), {})
unless next.$$route.originalPath is '/stream'
if current and next.$$route.originalPath is '/a/:id'
$scope.reloadAnnotations()
......@@ -777,6 +774,7 @@ class Search
$scope.filter_orderBy = $filter('orderBy')
$scope.matches = []
$scope.search.query = $location.search()
$scope.search.show = true
$scope.render_order = {}
$scope.render_pos = {}
$scope.ann_info =
......
......@@ -41,6 +41,9 @@ class StreamSearch
$rootScope.applyView "Document" # Non-sensical, but best for the moment
$rootScope.applySort "Newest"
$scope.search.query = $location.search()
$scope.search.show = not angular.equals($location.search(), {})
$scope.search.update = (searchCollection) ->
# Update the query parameters
query = queryparser.parseModels searchCollection.models
......
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