From f61d0cb45722dde004af85258e3e1dba7b46635f Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 27 Apr 2016 19:06:56 +0300 Subject: [PATCH] https://github.com/NodeBB/nodebb-plugin-composer-default/issues/24 --- public/src/app.js | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 791aabd628..a4acd0468b 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -455,26 +455,9 @@ app.cacheBuster = null; }; app.newTopic = function (cid) { - cid = cid || ajaxify.data.cid; - if (cid) { - $(window).trigger('action:composer.topic.new', { - cid: cid - }); - } else { - socket.emit('categories.getCategoriesByPrivilege', 'topics:create', function(err, categories) { - if (err) { - return app.alertError(err.message); - } - categories = categories.filter(function(category) { - return !category.link && !parseInt(category.parentCid, 10); - }); - if (categories.length) { - $(window).trigger('action:composer.topic.new', { - cid: categories[0].cid - }); - } - }); - } + $(window).trigger('action:composer.topic.new', { + cid: cid || ajaxify.data.cid || 0 + }); }; app.loadJQueryUI = function(callback) { @@ -546,5 +529,5 @@ app.cacheBuster = null; linkEl.href = config.relative_path + '/js-enabled.css'; document.head.appendChild(linkEl); - } + }; }());