diff --git a/imports/ui_3/views/components/comments-section.js b/imports/ui_3/views/components/comments-section.js index 363964cd5..7ae3d4291 100644 --- a/imports/ui_3/views/components/comments-section.js +++ b/imports/ui_3/views/components/comments-section.js @@ -28,7 +28,7 @@ Template.Comments_section.onRendered(function chatboxOnRendered() { // displayMessage('info', `You just seen ${topicId}`); // debug Meteor.user().hasNowSeen(topicId); }, - offset: '80%', + offset: 'bottom-in-view', }); // Above is nicer syntax , but requires bigu:jquery-waypoints https://stackoverflow.com/questions/28975693/using-jquery-waypoints-in-meteor /* this.waypoint = this.$('.comment-section').waypoint(function (direction) { @@ -71,6 +71,14 @@ Template.Comments_section.events({ const MAX_LENGTH = 400; +Template.Comment.onRendered(function () { + Waypoint.refreshAll(); +}); + +Template.Comment.onDestroyed(function () { + Waypoint.refreshAll(); +}); + Template.Comment.helpers({ textTooLong() { return this.text.length > MAX_LENGTH;