Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix search problem on mobile phone and some optimizations #973

Merged
merged 2 commits into from
Jul 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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