diff --git a/public/css/style.less b/public/css/style.less index a60ba220b3..5a44a064b0 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -832,7 +832,6 @@ body .navbar .nodebb-inline-block { .search-result-post { width: 100%; - height: 50px; line-height: 16px; padding: 5px; overflow:hidden; @@ -843,7 +842,5 @@ body .navbar .nodebb-inline-block { height:48px; padding-right:10px; } - span { - padding-left:10px; - } + } \ No newline at end of file diff --git a/public/src/forum/search.js b/public/src/forum/search.js new file mode 100644 index 0000000000..9412915cc7 --- /dev/null +++ b/public/src/forum/search.js @@ -0,0 +1,14 @@ +(function() { + + $(document).ready(function() { + var searchQuery = $('#topics-container').attr('data-search-query'); + + $('.search-result-text').each(function(){ + var text = $(this).html(); + var regex = new RegExp(searchQuery, 'gi'); + text = text.replace(regex, ''+searchQuery+''); + $(this).html(text); + }); + }); + +})(); \ No newline at end of file diff --git a/public/templates/search.tpl b/public/templates/search.tpl index 19a369600f..c08f82e7c5 100644 --- a/public/templates/search.tpl +++ b/public/templates/search.tpl @@ -12,7 +12,7 @@
- \ No newline at end of file