mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 01:26:16 +01:00
can mark topic unread for all
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
"link": "Link",
|
||||
|
||||
"thread_tools.title": "Thread Tools",
|
||||
"thread_tools.markAsUnreadForAll": "Mark Unread",
|
||||
"thread_tools.pin": "Pin Thread",
|
||||
"thread_tools.lock": "Lock Thread",
|
||||
"thread_tools.move": "Move Thread",
|
||||
|
||||
@@ -88,6 +88,15 @@ define(['composer'], function(composer) {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.markAsUnreadForAll').on('click', function() {
|
||||
socket.emit('topics.markAsUnreadForAll', tid, function(err) {
|
||||
if(err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
|
||||
moveThreadModal.on('shown.bs.modal', function() {
|
||||
|
||||
var loadingEl = document.getElementById('categories-loading');
|
||||
|
||||
@@ -146,6 +146,7 @@
|
||||
<div class="btn-group thread-tools hide">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">[[topic:thread_tools.title]] <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#" class="markAsUnreadForAll"><i class="fa fa-inbox"></i> [[topic:thread_tools.markAsUnreadForAll]]</a></li>
|
||||
<li><a href="#" class="pin_thread"><i class="fa fa-thumb-tack"></i> [[topic:thread_tools.pin]]</a></li>
|
||||
<li><a href="#" class="lock_thread"><i class="fa fa-lock"></i> [[topic:thread_tools.lock]]</a></li>
|
||||
<li class="divider"></li>
|
||||
@@ -171,6 +172,7 @@
|
||||
<div class="btn-group thread-tools hide">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">[[topic:thread_tools.title]] <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#" class="markAsUnreadForAll"><i class="fa fa-inbox"></i> [[topic:thread_tools.markAsUnreadForAll]]</a></li>
|
||||
<li><a href="#" class="pin_thread"><i class="fa fa-thumb-tack"></i> [[topic:thread_tools.pin]]</a></li>
|
||||
<li><a href="#" class="lock_thread"><i class="fa fa-lock"></i> [[topic:thread_tools.lock]]</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
@@ -83,6 +83,16 @@ SocketTopics.markAllRead = function(socket, data, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
SocketTopics.markAsUnreadForAll = function(socket, tid, callback) {
|
||||
topics.markAsUnreadForAll(tid, function(err) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
topics.pushUnreadCount();
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function doTopicAction(action, socket, tid, callback) {
|
||||
if(!tid) {
|
||||
return callback(new Error('Invalid tid'));
|
||||
|
||||
Reference in New Issue
Block a user