Permalink
Browse files

fix search problem on mobile phone and some optimizations

  • Loading branch information...
JounQin committed Jul 4, 2016
1 parent 60655d6 commit 04de66a483a29b6d8bf26a7af6a91f146e94de21
Showing with 7 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +2 −2 layout/_partials/header.swig
  3. +4 −4 layout/_scripts/third-party/localsearch.swig
  4. +0 −1 test/.jshintrc
View
@@ -1,6 +1,7 @@
.DS_Store
.idea/
*.log
+*.iml
node_modules/
# Ignore unused verdors' files
@@ -46,9 +46,9 @@
{% if hasSearch %}
<li class="menu-item menu-item-search">
{% if theme.swiftype_key %}
- <a href="#" class="st-search-show-outputs">
+ <a href="javascript:;" class="st-search-show-outputs">
{% elseif config.search %}
- <a href="#" class="popup-trigger">
+ <a href="javascript:;" class="popup-trigger">
{% endif %}
{% if theme.menu_icons.enable %}
<i class="menu-item-icon fa fa-search fa-fw"></i> <br />
@@ -37,7 +37,7 @@
var $resultContent = document.getElementById(content_id);
$input.addEventListener('input', function(){
var matchcounts = 0;
- var str='<ul class=\"search-result-list\">';
+ var str='<ul class=\"search-result-list\">';
var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
$resultContent.innerHTML = "";
if (this.value.trim().length > 1) {
@@ -92,7 +92,7 @@
var regS = new RegExp(keyword, "gi");
match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>");
});
-
+
str += "<p class=\"search-result\">" + match_content +"...</p>"
}
str += "</li>";
@@ -108,7 +108,7 @@
});}
// handle and trigger popup window;
- $('.popup-trigger').mousedown(function(e) {
+ $('.popup-trigger').click(function(e) {
e.stopPropagation();
if (isfetched == false) {
searchFunc(path, 'local-search-input', 'local-search-result');
@@ -127,4 +127,4 @@
e.stopPropagation();
});
</script>
-{% endif %}
+{% endif %}
View
@@ -4,7 +4,6 @@
"eqeqeq": true,
"undef": true,
"newcap": true,
- "undef": true,
"unused": true,
"laxcomma": false,
"asi": false,

0 comments on commit 04de66a

Please sign in to comment.