From a934d7d7f47f9333221ced4f4e6c512eb477e045 Mon Sep 17 00:00:00 2001 From: Vlad Topala Date: Mon, 26 Oct 2015 22:49:12 +0200 Subject: [PATCH] TG-3383 Cannot switch search result tabs until search results are received --- app/coffee/modules/search.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/search.coffee b/app/coffee/modules/search.coffee index da1d758b..20472aa9 100644 --- a/app/coffee/modules/search.coffee +++ b/app/coffee/modules/search.coffee @@ -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,