diff --git a/public/home/search.js b/public/home/search.js index a5994db58..a077151c1 100644 --- a/public/home/search.js +++ b/public/home/search.js @@ -118,6 +118,9 @@ function searchItem(type,sortType){ function search(){ console.log("enter here 1."); currentSearchKeyword = document.getElementById("keyword_input").value; + if(!isEmpty(currentSearchKeyword)){ + currentSearchKeyword = currentSearchKeyword.trim(); + } $('#searchForm').addClass("hiddenSearch"); initPageInfo(); if(!isEmpty(currentSearchKeyword)){ @@ -899,26 +902,18 @@ function getYPosition(e){ $('#keyword_input').on('keypress',function(event){ if(event.keyCode == 13){ - var keyword = $('#keyword_input').val(); - if(!isEmpty(keyword)){ - search(); - } + search(); } }); document.onreadystatechange = function() { if (document.readyState === "complete") { - var keyword = $('#keyword_input').val(); - if(!isEmpty(keyword)){ - search(); - } + search(); } } - - var LanguagesColor = { "1C Enterprise": "#814CCC", "ABAP": "#E8274B",