diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index df38821297..df17bc70e4 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -61,12 +61,6 @@ $(document).ready(function() { }); }); - require(['search'], function(search) { - if (search.topicDOM.active && !url.startsWith('topic/')) { - search.topicDOM.end(); - } - }); - return true; }; diff --git a/public/src/client/topic.js b/public/src/client/topic.js index 68cf8ba123..e6b932cb98 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -27,6 +27,14 @@ define('forum/topic', [ events.removeListeners(); } + + if (!data.url.startsWith('topic/')) { + require(['search'], function(search) { + if (search.topicDOM.active) { + search.topicDOM.end(); + } + }); + } }); Topic.init = function() {