Skip to content

Commit

Permalink
Load root annotations for replies in initial stream search
Browse files Browse the repository at this point in the history
  • Loading branch information
gergely-ujvari committed Mar 20, 2015
1 parent 484fdad commit 1374372
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion h/static/scripts/streamsearch.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,25 @@ class StreamSearchController
store.SearchResource.get query, ({rows}) ->
annotationMapper.loadAnnotations(rows)

# Fetch the root parents
rootAnnotations = []
for annotation in rows
if annotation.references?
rootId = annotation.references[0]
if rootId not in rootAnnotations
rootAnnotations.push(rootId)

for id in rootAnnotations
store.AnnotationResource.read {id: id}, (annotation) ->
annotationMapper.loadAnnotations([annotation])

$scope.isEmbedded = false
$scope.isStream = true

$scope.sort.name = 'Newest'

$scope.shouldShowThread = (container) -> true
$scope.shouldShowThread = (container) ->
container.message isnt null

$scope.$on '$destroy', ->
$scope.search.query = ''
Expand Down

0 comments on commit 1374372

Please sign in to comment.