adding return false to favouriting and following. using jq for follow code

This commit is contained in:
psychobunny
2014-02-04 10:37:27 -05:00
parent 5c957e8f8b
commit cecd3fe969

View File

@@ -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,8 +325,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
set_follow_state(state, true);
});
if (followEl[0]) {
followEl[0].addEventListener('click', function() {
followEl.on('click', function() {
socket.emit('topics.follow', tid, function(err, state) {
if(err) {
return app.alert({
@@ -340,8 +339,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
set_follow_state(state);
});
}, false);
}
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() {