mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 03:03:40 +08:00
FIX: Never show the last read marker within 1 post of the last
This commit is contained in:
parent
1be800b673
commit
f0f5fbf132
|
@ -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.[]')
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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%;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user