From 880de5d9a9146923e7f379a70cd0364f83604669 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 23 Feb 2022 15:59:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=BB=E5=8A=A1=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/search.js | 15 ++++++++++++++- templates/explore/search_new.tmpl | 14 +++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) 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 @@ - +