Commit 491dbddf authored by Ujvari Gergely's avatar Ujvari Gergely

For the more labels it displays how many more is there.

Removed debug messages
parent f3301a45
......@@ -437,6 +437,8 @@ class Search
shown : {}
more_top : {}
more_bottom : {}
more_top_num : {}
more_bottom_num: {}
buildRenderOrder = (threadid, threads) =>
......@@ -445,9 +447,6 @@ class Search
sorted = $scope.filter_orderBy threads, $scope.sortThread, true
for thread in sorted
console.log 'thread'
console.log thread
$scope.render_pos[thread.message.id] = $scope.render_order[threadid].length
$scope.render_order[threadid].push thread.message.id
buildRenderOrder(threadid, thread.children)
......@@ -498,7 +497,6 @@ class Search
if annotation.id in $scope.search_filter
threads.push thread
console.log 'main found'
$scope.render_order[annotation.id] = []
buildRenderOrder(annotation.id, [thread])
continue
......@@ -514,7 +512,6 @@ class Search
if has_search_result
threads.push thread
console.log 'has_search_result'
$scope.render_order[annotation.id] = []
buildRenderOrder(annotation.id, [thread])
......@@ -550,20 +547,22 @@ class Search
$scope.ann_info.more_top[child.id] = setMoreTop(thread.message.id, child)
$scope.ann_info.more_bottom[child.id] = setMoreBottom(thread.message.id, child)
console.log 'search filter'
console.log $scope.search_filter
console.log 'render_order'
console.log $scope.render_order
console.log 'render_pos'
console.log $scope.render_pos
# Calculate the number of hidden annotations for <x> more labels
for threadid, order of $scope.render_order
hidden = 0
last_shown = null
for id in order
if id in $scope.search_filter
if last_shown? then $scope.ann_info.more_bottom_num[last_shown] = hidden
$scope.ann_info.more_top_num[id] = hidden
last_shown = id
hidden = 0
else
hidden += 1
if last_shown? then $scope.ann_info.more_bottom_num[last_shown] = hidden
console.log 'info'
console.log $scope.ann_info
$scope.threads = threads
#Replace this with threading call
$scope.$on '$routeUpdate', refresh
......@@ -575,7 +574,6 @@ class Search
threadid
$scope.clickMoreTop = (id) ->
console.log 'clickMoreTop'
threadid = $scope.getThreadId id
pos = $scope.render_pos[id]
rendered = $scope.render_order[threadid]
......
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