From 6c9c6475d60bbd9242896c03b8737b4cda02f41e Mon Sep 17 00:00:00 2001 From: Juanfran Date: Fri, 5 Jun 2015 08:14:14 +0200 Subject: [PATCH] Issue 2711 - select the first search tab on search --- app/coffee/modules/search.coffee | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/coffee/modules/search.coffee b/app/coffee/modules/search.coffee index a3dd1006..30955c32 100644 --- a/app/coffee/modules/search.coffee +++ b/app/coffee/modules/search.coffee @@ -164,12 +164,15 @@ SearchDirective = ($log, $compile, $templatecache, $routeparams, $location) -> selectedSectionName = null selectedSectionData = null - for name, value of data - continue if name == "count" - if value.length > maxVal - maxVal = value.length - selectedSectionName = name - selectedSectionData = value + if data + for name in ["userstories", "issues", "tasks", "wikipages"] + value = data[name] + + if value.length > maxVal + maxVal = value.length + selectedSectionName = name + selectedSectionData = value + break; if maxVal == 0 return {name: "userstories", value: []}