check if there is follow element

This commit is contained in:
Baris Soner Usakli
2013-08-16 17:04:08 -04:00
parent 6690f49c4e
commit 00cb15d3c8
2 changed files with 9 additions and 4 deletions

View File

@@ -195,12 +195,14 @@
});
}
});
socket.emit('api:topic.followCheck', tid);
followEl[0].addEventListener('click', function() {
socket.emit('api:topic.follow', tid);
}, false);
if(followEl[0]) {
followEl[0].addEventListener('click', function() {
socket.emit('api:topic.follow', tid);
}, false);
}
// Infinite scrolling of posts
$(window).off('scroll').on('scroll', function() {
var bottom = (document.body.offsetHeight - $(window).height()) * 0.9;