TG-3383 Cannot switch search result tabs until search results are received

stable
Vlad Topala 2015-10-26 22:49:12 +02:00
parent 2a4b3ab81a
commit a934d7d7f4
1 changed files with 4 additions and 4 deletions

View File

@ -172,7 +172,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
applyAutoTab = true
activeSectionName = "userstories"
tabsDom = $el.find("section.search-filter")
lastSeatchResults = null
lastSearchResults = null
getActiveSection = (data) ->
maxVal = 0
@ -237,9 +237,9 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
$el.find(".search-result-table").html(element)
$scope.$watch "searchResults", (data) ->
lastSeatchResults = data
lastSearchResults = data
return if !lastSeatchResults
return if !lastSearchResults
activeSection = getActiveSection(data)
@ -256,7 +256,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
target = angular.element(event.currentTarget)
sectionName = target.parent().data("name")
sectionData = lastSeatchResults[sectionName]
sectionData = if !lastSearchResults then [] else lastSearchResults[sectionName]
section = {
name: sectionName,