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