mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 06:46:02 +02:00
updated category watch control
This commit is contained in:
@@ -13,6 +13,10 @@
|
||||
"share_this_category": "Share this category",
|
||||
"watch": "Watch",
|
||||
"ignore": "Ignore",
|
||||
"watching": "Watching",
|
||||
"ignoring": "Ignoring",
|
||||
"watching.description": "Show topics in unread",
|
||||
"ignoring.description": "Do not show topics in unread",
|
||||
|
||||
"watch.message": "You are now watching updates from this category",
|
||||
"ignore.message": "You are now ignoring updates from this category",
|
||||
|
||||
@@ -62,17 +62,20 @@ define('forum/category', [
|
||||
};
|
||||
|
||||
function handleIgnoreWatch(cid) {
|
||||
$('.watch, .ignore').on('click', function() {
|
||||
$('[component="category/watching"], [component="category/ignoring"]').on('click', function() {
|
||||
var $this = $(this);
|
||||
var command = $this.hasClass('watch') ? 'watch' : 'ignore';
|
||||
var command = $this.attr('component') === 'category/watching' ? 'watch' : 'ignore';
|
||||
|
||||
socket.emit('categories.' + command, cid, function(err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
$('.watch').toggleClass('hidden', command === 'watch');
|
||||
$('.ignore').toggleClass('hidden', command === 'ignore');
|
||||
$('[component="category/watching/menu"]').toggleClass('hidden', command !== 'watch');
|
||||
$('[component="category/watching/check"]').toggleClass('fa-check', command === 'watch');
|
||||
|
||||
$('[component="category/ignoring/menu"]').toggleClass('hidden', command !== 'ignore');
|
||||
$('[component="category/ignoring/check"]').toggleClass('fa-check', command === 'ignore');
|
||||
|
||||
app.alertSuccess('[[category:' + command + '.message]]');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user