From 49bf27d98548eafe804cfba78d882e3565a5bd09 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sun, 14 Aug 2016 21:40:58 +0300 Subject: [PATCH] closes #4944 --- public/src/client/topic/fork.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/src/client/topic/fork.js b/public/src/client/topic/fork.js index 2083a4867e..ca30f157b0 100644 --- a/public/src/client/topic/fork.js +++ b/public/src/client/topic/fork.js @@ -4,9 +4,9 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, postSelect) { - var Fork = {}, - forkModal, - forkCommit; + var Fork = {}; + var forkModal; + var forkCommit; Fork.init = function() { $('.topic').on('click', '[component="topic/fork"]', onForkThreadClicked); @@ -95,7 +95,10 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po components.get('post', 'pid', pid).toggleClass('bg-success', false); }); - forkModal.remove(); + if (forkModal) { + forkModal.remove(); + forkModal = null; + } components.get('topic').off('click', '[data-pid]'); postSelect.enableClicksOnPosts();