fix: closes #11673, topic search for harmony

harmony uses dropdown for search persona and older themes used a hidden input element in the navbar
This commit is contained in:
Barış Soner Uşaklı
2023-06-04 16:31:21 -04:00
parent 639eeb4492
commit ee8cb3782b
2 changed files with 19 additions and 5 deletions

View File

@@ -84,7 +84,10 @@ define('forum/topic', [
require(['search'], function (search) {
mousetrap.bind(['command+f', 'ctrl+f'], function (e) {
e.preventDefault();
const form = $('[component="navbar"] [component="search/form"]');
let form = $('[component="navbar"] [component="search/form"]');
if (!form.length) { // harmony
form = $('[component="sidebar/right"] [component="search/form"]');
}
form.find('[component="search/fields"] input[name="query"]').val('in:topic-' + ajaxify.data.tid + ' ');
search.showAndFocusInput(form);
});