mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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 $body = $('body');
|
||||||
const elemId = `#post_${post.get('post_number')}`;
|
const elemId = `#post_${post.get('post_number')}`;
|
||||||
const $elem = $(elemId).closest('.post-cloak');
|
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() {
|
postStream.prependMore().then(function() {
|
||||||
Em.run.next(function () {
|
Em.run.next(function () {
|
||||||
|
@ -310,7 +310,6 @@ export default RestModel.extend({
|
|||||||
if (Ember.isEmpty(postIds)) { return Ember.RSVP.resolve(); }
|
if (Ember.isEmpty(postIds)) { return Ember.RSVP.resolve(); }
|
||||||
|
|
||||||
this.set('loadingBelow', true);
|
this.set('loadingBelow', true);
|
||||||
|
|
||||||
const postsWithPlaceholders = this.get('postsWithPlaceholders');
|
const postsWithPlaceholders = this.get('postsWithPlaceholders');
|
||||||
postsWithPlaceholders.appending(postIds);
|
postsWithPlaceholders.appending(postIds);
|
||||||
return this.findPostsByIds(postIds).then(posts => {
|
return this.findPostsByIds(postIds).then(posts => {
|
||||||
@ -483,7 +482,11 @@ export default RestModel.extend({
|
|||||||
this.get('stream').addObject(postId);
|
this.get('stream').addObject(postId);
|
||||||
if (loadedAllPosts) {
|
if (loadedAllPosts) {
|
||||||
this.set('loadingLastPost', true);
|
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
Block a user