FIX: Don't show placeholder when triggering one post
This commit is contained in:
parent
8f1937e88f
commit
467485cf47
|
@ -693,7 +693,8 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
|||
const $body = $('body');
|
||||
const elemId = `#post_${post.get('post_number')}`;
|
||||
const $elem = $(elemId).closest('.post-cloak');
|
||||
const distToElement = $body.scrollTop() - $elem.position().top;
|
||||
const elemPos = $elem.position();
|
||||
const distToElement = elemPos ? $body.scrollTop() - elemPos.top : 0;
|
||||
|
||||
postStream.prependMore().then(function() {
|
||||
Em.run.next(function () {
|
||||
|
|
|
@ -310,7 +310,6 @@ export default RestModel.extend({
|
|||
if (Ember.isEmpty(postIds)) { return Ember.RSVP.resolve(); }
|
||||
|
||||
this.set('loadingBelow', true);
|
||||
|
||||
const postsWithPlaceholders = this.get('postsWithPlaceholders');
|
||||
postsWithPlaceholders.appending(postIds);
|
||||
return this.findPostsByIds(postIds).then(posts => {
|
||||
|
@ -483,7 +482,11 @@ export default RestModel.extend({
|
|||
this.get('stream').addObject(postId);
|
||||
if (loadedAllPosts) {
|
||||
this.set('loadingLastPost', true);
|
||||
this.appendMore().finally(()=> this.set('loadingLastPost', true));
|
||||
this.findPostsByIds([postId]).then(posts => {
|
||||
posts.forEach(p => this.appendPost(p));
|
||||
}).finally(() => {
|
||||
this.set('loadingLastPost', false);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue