diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index a67b349118..24e2d66cd2 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -53,7 +53,13 @@ jQuery('#search-fields').hide(); jQuery('#search-button').show(); }); + + $('#search-fields input').on('blur', function() { + $('#search-fields').hide(); + $('#search-button').show(); + }); }); + var rightMenu = $('#right-menu'), isLoggedIn = data.uid > 0; @@ -82,6 +88,7 @@ rightMenu.append(logoutli); } } else { + $('#search-button').hide(); jQuery('.nodebb-loggedin').hide(); jQuery('.nodebb-loggedout').show(); diff --git a/public/src/forum/search.js b/public/src/forum/search.js index c21baec1e6..4d53321ec8 100644 --- a/public/src/forum/search.js +++ b/public/src/forum/search.js @@ -2,13 +2,16 @@ $(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); }); + + + $('#search-form input').val(searchQuery); }); })(); \ No newline at end of file diff --git a/public/templates/header.tpl b/public/templates/header.tpl index fb5624cae7..710f943560 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -63,13 +63,13 @@ +
+ +
+ + + +