mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix: bug where fallback to forum search was not working due to client-side error
This commit is contained in:
@@ -75,11 +75,8 @@ define('admin/modules/search', ['mousetrap', 'alerts'], function (mousetrap, ale
|
||||
|
||||
$('#acp-search').parents('form').on('submit', function (ev) {
|
||||
const query = input.val();
|
||||
let selected = menu.find('li.result > a.focus').attr('href');
|
||||
if (!selected.length) {
|
||||
selected = menu.find('li.result > a').first().attr('href');
|
||||
}
|
||||
const href = selected || config.relative_path + '/search?in=titlesposts&term=' + escape(query);
|
||||
const selected = menu.get(0).querySelector('li.result > a.focus') || menu.get(0).querySelector('li.result > a');
|
||||
const href = selected ? selected.getAttribute('href') : config.relative_path + '/search?in=titlesposts&term=' + escape(query);
|
||||
|
||||
ajaxify.go(href.replace(/^\//, ''));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user