mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-24 23:51:18 +01:00
closes #2850
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
/* globals define, app, socket, utils */
|
||||
|
||||
define('forum/recent', ['forum/infinitescroll'], function(infinitescroll) {
|
||||
define('forum/recent', ['forum/infinitescroll', 'composer'], function(infinitescroll, composer) {
|
||||
var Recent = {};
|
||||
|
||||
var newTopicCount = 0,
|
||||
@@ -23,6 +23,17 @@ define('forum/recent', ['forum/infinitescroll'], function(infinitescroll) {
|
||||
$(this).addClass('hide');
|
||||
});
|
||||
|
||||
$('#new_topic').on('click', function() {
|
||||
socket.emit('categories.getCategoriesByPrivilege', 'topics:create', function(err, categories) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
if (categories.length) {
|
||||
composer.newTopic(categories[0].cid);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
infinitescroll.init(Recent.loadMoreTopics);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user