FIX: Never show the last read marker within 1 post of the last

This commit is contained in:
Robin Ward 2016-12-20 13:13:46 -05:00
parent 1be800b673
commit f0f5fbf132
4 changed files with 19 additions and 16 deletions

View File

@ -39,9 +39,11 @@ export default Ember.Component.extend({
@computed('progressPosition', 'topic.last_read_post_id')
showBackButton(position, lastReadId) {
if (!this.site.mobileView || !lastReadId) { return; }
const readPos = this.get('postStream.stream').indexOf(lastReadId) || 0;
return readPos > position;
if (!lastReadId) { return; }
const stream = this.get('postStream.stream');
const readPos = stream.indexOf(lastReadId) || 0;
return (readPos < (stream.length - 1)) && (readPos > position);
},
@observes('postStream.stream.[]')

View File

@ -165,6 +165,7 @@ createWidget('timeline-scrollarea', {
const hasBackPosition =
position.lastRead > 3 &&
Math.abs(position.lastRead - position.current) > 3 &&
Math.abs(position.lastRead - position.total) > 1 &&
(position.lastRead && position.lastRead !== position.total);
if (hasBackPosition) {

View File

@ -87,6 +87,19 @@
width: 757px;
}
.progress-back-container {
position: fixed;
width: 0;
right: 0;
bottom: 40px;
z-index: 950;
margin-right: 105px;
.btn {
margin: 0;
}
}
#topic-progress-wrapper {
position: fixed;
right: 50%;

View File

@ -61,19 +61,6 @@
margin-right: 148px;
}
.progress-back-container {
position: fixed;
width: 0;
right: 0;
bottom: 40px;
z-index: 950;
margin-right: 105px;
.btn {
margin: 0;
}
}
#topic-progress-expanded {
border: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
padding: 5px;