fix: bug where fallback to forum search was not working due to client-side error

isekai-main
Julian Lam 3 years ago
parent 1b9c68196f
commit 25046642e7

@ -75,11 +75,8 @@ define('admin/modules/search', ['mousetrap', 'alerts'], function (mousetrap, ale
$('#acp-search').parents('form').on('submit', function (ev) { $('#acp-search').parents('form').on('submit', function (ev) {
const query = input.val(); const query = input.val();
let selected = menu.find('li.result > a.focus').attr('href'); const selected = menu.get(0).querySelector('li.result > a.focus') || menu.get(0).querySelector('li.result > a');
if (!selected.length) { const href = selected ? selected.getAttribute('href') : config.relative_path + '/search?in=titlesposts&term=' + escape(query);
selected = menu.find('li.result > a').first().attr('href');
}
const href = selected || config.relative_path + '/search?in=titlesposts&term=' + escape(query);
ajaxify.go(href.replace(/^\//, '')); ajaxify.go(href.replace(/^\//, ''));

Loading…
Cancel
Save