Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.3.2^2
zouap 4 years ago
parent
commit
bbe133a29f
3 changed files with 15 additions and 6 deletions
  1. +2
    -2
      public/home/home.js
  2. +7
    -2
      public/home/search.js
  3. +6
    -2
      templates/explore/search_new.tmpl

+ 2
- 2
public/home/home.js View File

@@ -229,9 +229,9 @@ function getPRLink(record){
}
function getPRText(record){
if(record.Repo.Alias){
return encodeURI(record.Repo.OwnerName + "/" + record.Repo.Alias + "#" + getIssueId(record));
return record.Repo.OwnerName + "/" + record.Repo.Alias + "#" + getIssueId(record);
}else{
return encodeURI(record.Repo.OwnerName + "/" + record.Repo.Name + "#" + getIssueId(record));
return record.Repo.OwnerName + "/" + record.Repo.Name + "#" + getIssueId(record);
}

}


+ 7
- 2
public/home/search.js View File

@@ -98,7 +98,6 @@ function search(){
console.log("enter here 1.");
currentSearchKeyword = document.getElementById("keyword_input").value;
initPageInfo();

if(!isEmpty(currentSearchKeyword)){
currentSearchTableName = "repository";
currentSearchSortBy = sortBy[11];
@@ -115,7 +114,10 @@ function search(){

function searchLabel(tableName,keyword,sortBy="",ascending=false){
console.log("enter label search.");
$('#keyword_input').val(keyword);
document.getElementById("search_div").style.display=none;
document.getElementById("search_label_div").style.display="block";
document.getElementById("search_label_div").innerHTML="<span>" + keyword + "</span>";
//$('#keyword_input').val(keyword);
currentSearchKeyword = keyword;
initPageInfo();
currentSearchTableName = tableName;
@@ -667,6 +669,9 @@ $('#keyword_input').on('keypress',function(event){
}
});

document.getElementById("search_div").style.display="block";
document.getElementById("search_label_div").style.display=none;

document.onreadystatechange = function() {
if (document.readyState === "complete") {
var keyword = $('#keyword_input').val();


+ 6
- 2
templates/explore/search_new.tmpl View File

@@ -3,8 +3,8 @@
<div class="explore seach">
<div class="repos--seach">
<div class="ui container">
<div class="ui two column centered grid">
<div class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin-top:1.2rem;margin-bottom: 1.2rem;">
<div id="search_div" class="ui two column centered grid">
<div class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin-top:1.2rem;margin-bottom: 1.2rem;">
<div class="ui fluid action input">
<input name="q" id="keyword_input" value="{{.Keyword}}" placeholder="搜索..." autofocus="">
<input type="hidden" name="topic" value="">
@@ -13,7 +13,11 @@
<button class="ui green button" onclick="search()">搜索</button>
</div>
</div>
</div>
<div id="search_label_div" style="display:none">
</div>
</div>



Loading…
Cancel
Save