TG-3383 Cannot switch search result tabs until search results are received
parent
2a4b3ab81a
commit
a934d7d7f4
|
@ -172,7 +172,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
|
||||||
applyAutoTab = true
|
applyAutoTab = true
|
||||||
activeSectionName = "userstories"
|
activeSectionName = "userstories"
|
||||||
tabsDom = $el.find("section.search-filter")
|
tabsDom = $el.find("section.search-filter")
|
||||||
lastSeatchResults = null
|
lastSearchResults = null
|
||||||
|
|
||||||
getActiveSection = (data) ->
|
getActiveSection = (data) ->
|
||||||
maxVal = 0
|
maxVal = 0
|
||||||
|
@ -237,9 +237,9 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
|
||||||
$el.find(".search-result-table").html(element)
|
$el.find(".search-result-table").html(element)
|
||||||
|
|
||||||
$scope.$watch "searchResults", (data) ->
|
$scope.$watch "searchResults", (data) ->
|
||||||
lastSeatchResults = data
|
lastSearchResults = data
|
||||||
|
|
||||||
return if !lastSeatchResults
|
return if !lastSearchResults
|
||||||
|
|
||||||
activeSection = getActiveSection(data)
|
activeSection = getActiveSection(data)
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) ->
|
||||||
target = angular.element(event.currentTarget)
|
target = angular.element(event.currentTarget)
|
||||||
|
|
||||||
sectionName = target.parent().data("name")
|
sectionName = target.parent().data("name")
|
||||||
sectionData = lastSeatchResults[sectionName]
|
sectionData = if !lastSearchResults then [] else lastSearchResults[sectionName]
|
||||||
|
|
||||||
section = {
|
section = {
|
||||||
name: sectionName,
|
name: sectionName,
|
||||||
|
|
Loading…
Reference in New Issue