FIX: Some last read position fixes

This commit is contained in:
Robin Ward 2016-06-01 17:27:06 -04:00
parent c3ceb6ef7d
commit 810b213ca0
No known key found for this signature in database
GPG Key ID: 0E091E2B4ED1B83D
2 changed files with 4 additions and 2 deletions

View File

@ -134,7 +134,9 @@ export default Ember.Component.extend({
isDocked = offset >= threshold - windowHeight + topicProgressHeight + composerHeight;
}
const dockPos = $(document).height() - $('#topic-footer-main-buttons').offset().top - topicProgressHeight;
const $mainButtons = $('#topic-footer-main-buttons');
const mainPos = $mainButtons.length > 0 ? $mainButtons.offset().top : 0;
const dockPos = $(document).height() - mainPos - topicProgressHeight;
if (composerHeight > 0) {
if (isDocked) {

View File

@ -870,7 +870,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
}
const max = _.max(postNumbers);
if (max > topic.get("last_read_post_number")) {
if (max > (topic.get("last_read_post_number") || 0)) {
topic.set("last_read_post_number", max);
}