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) {
|
set_follow_state = function(state, quiet) {
|
||||||
if (state && !followEl.hasClass('btn-success')) {
|
if (state && !followEl.hasClass('btn-success')) {
|
||||||
followEl.addClass('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) {
|
if (!quiet) {
|
||||||
app.alert({
|
app.alert({
|
||||||
alert_id: 'topic_follow',
|
alert_id: 'topic_follow',
|
||||||
@@ -308,7 +308,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
}
|
}
|
||||||
} else if (!state && followEl.hasClass('btn-success')) {
|
} else if (!state && followEl.hasClass('btn-success')) {
|
||||||
followEl.removeClass('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) {
|
if (!quiet) {
|
||||||
app.alert({
|
app.alert({
|
||||||
alert_id: 'topic_follow',
|
alert_id: 'topic_follow',
|
||||||
@@ -325,8 +325,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
set_follow_state(state, true);
|
set_follow_state(state, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (followEl[0]) {
|
followEl.on('click', function() {
|
||||||
followEl[0].addEventListener('click', function() {
|
|
||||||
socket.emit('topics.follow', tid, function(err, state) {
|
socket.emit('topics.follow', tid, function(err, state) {
|
||||||
if(err) {
|
if(err) {
|
||||||
return app.alert({
|
return app.alert({
|
||||||
@@ -340,8 +339,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
|
|
||||||
set_follow_state(state);
|
set_follow_state(state);
|
||||||
});
|
});
|
||||||
}, false);
|
|
||||||
}
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
enableInfiniteLoading();
|
enableInfiniteLoading();
|
||||||
|
|
||||||
@@ -438,6 +438,8 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
pid: pid,
|
pid: pid,
|
||||||
room_id: app.currentRoom
|
room_id: app.currentRoom
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#post-container').on('click', '.flag', function() {
|
$('#post-container').on('click', '.flag', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user