mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-21 16:00:26 +01:00
refactor: use search api for topic search
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user