mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
adding return false to favouriting and following. using jq for follow code
This commit is contained in:
@@ -296,7 +296,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
||||
set_follow_state = function(state, quiet) {
|
||||
if (state && !followEl.hasClass('btn-success')) {
|
||||
followEl.addClass('btn-success');
|
||||
followEl[0].title = 'You are currently receiving updates to this topic';
|
||||
followEl.attr('title', 'You are currently receiving updates to this topic');
|
||||
if (!quiet) {
|
||||
app.alert({
|
||||
alert_id: 'topic_follow',
|
||||
@@ -308,7 +308,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
||||
}
|
||||
} else if (!state && followEl.hasClass('btn-success')) {
|
||||
followEl.removeClass('btn-success');
|
||||
followEl[0].title = 'Be notified of new replies in this topic';
|
||||
followEl.attr('title', 'Be notified of new replies in this topic');
|
||||
if (!quiet) {
|
||||
app.alert({
|
||||
alert_id: 'topic_follow',
|
||||
@@ -325,23 +325,23 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
||||
set_follow_state(state, true);
|
||||
});
|
||||
|
||||
if (followEl[0]) {
|
||||
followEl[0].addEventListener('click', function() {
|
||||
socket.emit('topics.follow', tid, function(err, state) {
|
||||
if(err) {
|
||||
return app.alert({
|
||||
type: 'danger',
|
||||
alert_id: 'topic_follow',
|
||||
title: 'Please Log In',
|
||||
message: 'Please register or log in in order to subscribe to this topic',
|
||||
timeout: 5000
|
||||
});
|
||||
}
|
||||
followEl.on('click', function() {
|
||||
socket.emit('topics.follow', tid, function(err, state) {
|
||||
if(err) {
|
||||
return app.alert({
|
||||
type: 'danger',
|
||||
alert_id: 'topic_follow',
|
||||
title: 'Please Log In',
|
||||
message: 'Please register or log in in order to subscribe to this topic',
|
||||
timeout: 5000
|
||||
});
|
||||
}
|
||||
|
||||
set_follow_state(state);
|
||||
});
|
||||
}, false);
|
||||
}
|
||||
set_follow_state(state);
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
enableInfiniteLoading();
|
||||
|
||||
@@ -438,6 +438,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
||||
pid: pid,
|
||||
room_id: app.currentRoom
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#post-container').on('click', '.flag', function() {
|
||||
|
||||
Reference in New Issue
Block a user