mirror of
https://github.com/flarum/core.git
synced 2025-08-07 08:56:38 +02:00
Use date of the post in index
This commit is contained in:
committed by
Franz Liedke
parent
875a1f70c1
commit
d20650fb42
@@ -208,16 +208,15 @@ export default class PostStream extends Component {
|
|||||||
const coversQuarterOfViewport = (height - visibleTop) / viewportHeight > 0.25;
|
const coversQuarterOfViewport = (height - visibleTop) / viewportHeight > 0.25;
|
||||||
if (index === undefined && (threeQuartersVisible || coversQuarterOfViewport)) {
|
if (index === undefined && (threeQuartersVisible || coversQuarterOfViewport)) {
|
||||||
index = parseFloat($this.data('index')) + visibleTop / height;
|
index = parseFloat($this.data('index')) + visibleTop / height;
|
||||||
|
// If this item has a time associated with it, then set the
|
||||||
|
// scrollbar's current period to a formatted version of this time.
|
||||||
|
const time = $this.data('time');
|
||||||
|
if (time) period = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visiblePost > 0) {
|
if (visiblePost > 0) {
|
||||||
visible += visiblePost / height;
|
visible += visiblePost / height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this item has a time associated with it, then set the
|
|
||||||
// scrollbar's current period to a formatted version of this time.
|
|
||||||
const time = $this.data('time');
|
|
||||||
if (time) period = time;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const indexChanged = Math.floor(this.state.index) != Math.floor(index);
|
const indexChanged = Math.floor(this.state.index) != Math.floor(index);
|
||||||
|
Reference in New Issue
Block a user