Added class to search-results in text when active
Improved function for search-results in text