diff --git a/public/home/search.js b/public/home/search.js index 337418bea..bd0222f7b 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -64,7 +64,7 @@ function search(){ var pageSize=15; if(!isEmpty(keyword)){ doSearch("repository",keyword,page,pageSize,false,sortBy[11]); - //doSearch("issue",keyword,page,pageSize,true); + doSearch("issue",keyword,page,pageSize,true); //doSearch("user",keyword,page,pageSize,true); //doSearch("org",keyword,page,pageSize,true); //doSearch("dataset",keyword,page,pageSize,true); @@ -165,6 +165,7 @@ function displayIssueResult(page,jsonResult,onlyReturnNum,keyword){ var total = jsonResult.Total; $('#issue_total').text(total); if(!onlyReturnNum){ + setActivate("issue_item"); $('#keyword_desc').text(keyword); $('#obj_desc').text("任务"); $('#child_total').text(total); @@ -202,12 +203,24 @@ function displayIssueResult(page,jsonResult,onlyReturnNum,keyword){ } } +function setActivate(name){ + $('#repo_item').removeClass("active"); + $('#user_item').removeClass("active"); + $('#issue_item').removeClass("active"); + $('#dataset_item').removeClass("active"); + $('#org_item').removeClass("active"); + $('#pr_item').removeClass("active"); + var tmp = "#" + name; + $(tmp).addClass("active"); +} + function displayRepoResult(page,jsonResult,onlyReturnNum,keyword){ var data = jsonResult.Result; var total = jsonResult.Total; $('#repo_total').text(total); if(!onlyReturnNum){ + setActivate("repo_item"); $('#keyword_desc').text(keyword); $('#obj_desc').text("项目"); $('#child_total').text(total); diff --git a/templates/explore/search_new.tmpl b/templates/explore/search_new.tmpl index 371083803..72591e250 100644 --- a/templates/explore/search_new.tmpl +++ b/templates/explore/search_new.tmpl @@ -17,30 +17,30 @@ - +