|
|
|
@ -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);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|