Skip to content
Snippets Groups Projects
Commit ee250ebf authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Merge branch '32-improve-search' into 'develop'

fix: optimize search script

See merge request R3/howto-cards!221
parents c6634b83 881ba760
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@
window.content = { {% for card in the_cards %}
"{{ card.url | slugify }}": {
"title": "{{ card.shortcut | xml_escape }}",
"content": {{ card.content | strip_html | strip_newlines | jsonify }},
"content": {{ card.content | strip_html | strip_newlines | truncate: 150 | jsonify }},
"url": "{{ card.url | xml_escape | relative_url }}"
} {% unless forloop.last %},{% endunless %} {% endfor %}
};
......@@ -68,7 +68,7 @@
for (var i = 0; i < results.length; i++) {
var node = document.createElement("tr");
node.innerHTML = construct_cell(prettify(window.content[results[i].ref].title),
window.content[results[i].ref].content.substring(0, 125) + '...',
window.content[results[i].ref].content.substring(0, 150) + '...',
window.content[results[i].ref].url);
el_table_body.appendChild(node);
}
......@@ -84,4 +84,4 @@
el_tr_placeholder.style.display = "none";
})
</script>
\ No newline at end of file
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment