refactor: use search api for topic search

This commit is contained in:
Barış Soner Uşaklı
2021-10-25 23:12:34 -04:00
parent 6cfaea06f0
commit 64192731a0
5 changed files with 27 additions and 123 deletions

View File

@@ -95,12 +95,9 @@ define('forum/topic', [
if (config.topicSearchEnabled) {
require(['mousetrap'], function (mousetrap) {
mousetrap.bind(['command+f', 'ctrl+f'], function (e) {
const match = ajaxify.currentPage.match(/^topic\/([\d]+)/);
let tid;
if (match) {
if (ajaxify.data.template.topic) {
e.preventDefault();
tid = match[1];
$('#search-fields input').val('in:topic-' + tid + ' ');
$('#search-fields input').val('in:topic-' + ajaxify.data.tid + ' ');
app.prepareSearch();
}
});