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