From 6d0d74a6e9292d485dd509bb73c37b0dd1b65103 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 10 Jun 2015 14:16:35 -0400 Subject: [PATCH] moved topic search end to topics.js --- public/src/ajaxify.js | 6 ------ public/src/client/topic.js | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) 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() {