Skip to content

Commit

Permalink
Merge pull request #973 from JounQin/master
Browse files Browse the repository at this point in the history
fix search problem on mobile phone and some optimizations
  • Loading branch information
iissnan authored Jul 6, 2016
2 parents 4573c73 + a05a189 commit 66c5b1c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
.idea/
*.log
*.iml
node_modules/

# Ignore unused verdors' files
Expand Down
4 changes: 2 additions & 2 deletions layout/_macro/wechat-subscriber.swig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% if theme.wechat_subscriber.enabled %}
<div id="wechat_subscriber" style="display: block padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
<div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
<img id="wechat_subscriber_qcode" src="{{ theme.wechat_subscriber.qcode }}" alt="{{ theme.author }} wechat" style="width: 200px; max-width: 100%;"/>
<div>{{ theme.wechat_subscriber.description }}</div>
</div>
{% endif %}
{% endif %}
4 changes: 2 additions & 2 deletions layout/_partials/header.swig
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 66c5b1c

Please sign in to comment.