Skip to content

Commit

Permalink
fix search problem on mobile phone and some optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jul 4, 2016
1 parent 60655d6 commit 04de66a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
.DS_Store
.idea/
*.log
*.iml
node_modules/

# Ignore unused verdors' files
Expand Down
4 changes: 2 additions & 2 deletions layout/_partials/header.swig
Expand Up @@ -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 />
Expand Down
8 changes: 4 additions & 4 deletions layout/_scripts/third-party/localsearch.swig
Expand Up @@ -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) {
Expand Down Expand Up @@ -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>";
Expand All @@ -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');
Expand All @@ -127,4 +127,4 @@
e.stopPropagation();
});
</script>
{% endif %}
{% endif %}
1 change: 0 additions & 1 deletion test/.jshintrc
Expand Up @@ -4,7 +4,6 @@
"eqeqeq": true,
"undef": true,
"newcap": true,
"undef": true,
"unused": true,
"laxcomma": false,
"asi": false,
Expand Down

0 comments on commit 04de66a

Please sign in to comment.