зеркало из https://github.com/telerik/docs-seed.git
fix: Decoding search query and enable filtering
This commit is contained in:
Родитель
9351e3ee6f
Коммит
78f372cbd6
|
@ -24,11 +24,8 @@ var searchViewModel = kendo.observable({
|
|||
return filterExpression;
|
||||
},
|
||||
getFilterExpression: function() {
|
||||
return '';
|
||||
|
||||
// TODO: Turn filter on after google indexing.
|
||||
// var filter = this.getFilter();
|
||||
// return filter !== '' ? PAGE_FILTER + filter : '';
|
||||
var filter = this.getFilter();
|
||||
return filter !== '' ? PAGE_FILTER + filter : '';
|
||||
},
|
||||
updateLabel: function() {
|
||||
var label = "";
|
||||
|
@ -164,7 +161,7 @@ $(function () {
|
|||
}
|
||||
|
||||
var params = location.search.replace(/(^\?)/, '').split("&").map(toKV.bind({}))[0];
|
||||
searchTerms = params.q;
|
||||
searchTerms = decodeURIComponent(params.q ? params.q.replace(/\+/g,' ') : '');
|
||||
$("[name=q]").val(searchTerms);
|
||||
|
||||
var ds = new kendo.data.DataSource({
|
||||
|
|
|
@ -75,7 +75,8 @@
|
|||
<li><a href="{{ item[1] }}" target="_blank" onclick="trackItemFromCurrentPage('docs-navigation', '{{ item[0] }}')">{{ item[0] }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
{% if page.is_search_page != true or site.has_search != false %}
|
||||
{% if site.has_search != false %}
|
||||
{% if page.is_search_page != true %}
|
||||
<li class="hidden-xs">
|
||||
<a class="search-icon">
|
||||
{% include icons/search.svg %}
|
||||
|
@ -87,6 +88,7 @@
|
|||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if site.download %}
|
||||
<li class="primary-cta"><a href="{{site.download}}" target="_blank" onclick="trackItemFromCurrentPage('docs-navigation', 'Try now')">Try now</a></li>
|
||||
{% endif %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче