| @@ -102,7 +102,6 @@ function initPageInfo(){ | |||||
| function searchItem(type,sortType){ | function searchItem(type,sortType){ | ||||
| console.log("enter item 2."); | console.log("enter item 2."); | ||||
| currentSearchKeyword = document.getElementById("keyword_input").value; | currentSearchKeyword = document.getElementById("keyword_input").value; | ||||
| sessionStorage.removeItem("searchLabel"); | |||||
| if(!isEmpty(currentSearchKeyword)){ | if(!isEmpty(currentSearchKeyword)){ | ||||
| initPageInfo(); | initPageInfo(); | ||||
| currentSearchTableName = itemType[type]; | currentSearchTableName = itemType[type]; | ||||
| @@ -122,7 +121,6 @@ function search(){ | |||||
| if(!isEmpty(currentSearchKeyword)){ | if(!isEmpty(currentSearchKeyword)){ | ||||
| currentSearchKeyword = currentSearchKeyword.trim(); | currentSearchKeyword = currentSearchKeyword.trim(); | ||||
| } | } | ||||
| sessionStorage.removeItem("searchLabel"); | |||||
| $('#searchForm').addClass("hiddenSearch"); | $('#searchForm').addClass("hiddenSearch"); | ||||
| initPageInfo(); | initPageInfo(); | ||||
| if(!isEmpty(currentSearchKeyword)){ | if(!isEmpty(currentSearchKeyword)){ | ||||
| @@ -212,23 +210,8 @@ function searchLabel(tableName,keyword,sortBy="",ascending="false"){ | |||||
| sessionStorage.setItem("searchLabel",true); | sessionStorage.setItem("searchLabel",true); | ||||
| sessionStorage.setItem("sortBy",sortBy); | sessionStorage.setItem("sortBy",sortBy); | ||||
| sessionStorage.setItem("ascending",ascending); | sessionStorage.setItem("ascending",ascending); | ||||
| console.log("enter label search."); | console.log("enter label search."); | ||||
| window.open("/all/search/"); | window.open("/all/search/"); | ||||
| // initDiv(true); | |||||
| // //document.getElementById("search_div").style.display="none"; | |||||
| // //document.getElementById("search_label_div").style.display="block"; | |||||
| // document.getElementById("search_label_div").innerHTML="<p class=\"searchlabel\">#" + keyword + "</p>"; | |||||
| // currentSearchKeyword = keyword; | |||||
| // initPageInfo(); | |||||
| // currentSearchTableName = tableName; | |||||
| // currentSearchSortBy = sortBy; | |||||
| // currentSearchAscending = ascending; | |||||
| // OnlySearchLabel =true; | |||||
| // page(currentPage); | |||||
| } | } | ||||
| function doSearch(tableName,keyword,page,pageSize=15,onlyReturnNum=true,sortBy="",OnlySearchLabel=false){ | function doSearch(tableName,keyword,page,pageSize=15,onlyReturnNum=true,sortBy="",OnlySearchLabel=false){ | ||||
| @@ -261,9 +244,6 @@ function doSearch(tableName,keyword,page,pageSize=15,onlyReturnNum=true,sortBy=" | |||||
| console.log("tableName=" + tableName); | console.log("tableName=" + tableName); | ||||
| console.log(json); | console.log(json); | ||||
| displayResult(tableName,page,json,onlyReturnNum,keyword); | displayResult(tableName,page,json,onlyReturnNum,keyword); | ||||
| if(OnlySearchLabel){ | |||||
| sessionStorage.removeItem("searchLabel"); | |||||
| } | |||||
| }, | }, | ||||
| error:function(response) { | error:function(response) { | ||||
| console.log(response); | console.log(response); | ||||
| @@ -1289,7 +1269,8 @@ var zhCN={ | |||||
| console.log("tmpSearchLabel=" + tmpSearchLabel); | console.log("tmpSearchLabel=" + tmpSearchLabel); | ||||
| if(tmpSearchLabel){ | if(tmpSearchLabel){ | ||||
| console.log("search label...."); | console.log("search label...."); | ||||
| doSearchLabel(sessionStorage.getItem("tableName"),sessionStorage.getItem("keyword"),sessionStorage.getItem("sortBy"),sessionStorage.getItem("ascending")) | |||||
| sessionStorage.removeItem("searchLabel"); | |||||
| doSearchLabel(sessionStorage.getItem("tableName"),sessionStorage.getItem("keyword"),sessionStorage.getItem("sortBy"),sessionStorage.getItem("ascending")); | |||||
| }else{ | }else{ | ||||
| console.log("normal search...."); | console.log("normal search...."); | ||||
| search(); | search(); | ||||