mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:17:30 +08:00
FIX: Jump to previously loaded post was broken
This commit is contained in:
parent
6d38640645
commit
63ba6c78af
|
@ -15,7 +15,7 @@ const DiscourseURL = Ember.Object.createWithMixins({
|
||||||
Jumps to a particular post in the stream
|
Jumps to a particular post in the stream
|
||||||
**/
|
**/
|
||||||
jumpToPost: function(postNumber, opts) {
|
jumpToPost: function(postNumber, opts) {
|
||||||
const holderId = `#post_${postNumber}`;
|
const holderId = `.post-cloak[data-post-number=${postNumber}]`;
|
||||||
const offset = function() {
|
const offset = function() {
|
||||||
|
|
||||||
const $header = $('header');
|
const $header = $('header');
|
||||||
|
|
|
@ -96,7 +96,7 @@ export default Ember.View.extend({
|
||||||
createArgs.context = target;
|
createArgs.context = target;
|
||||||
}
|
}
|
||||||
if (controller) { createArgs.controller = controller; }
|
if (controller) { createArgs.controller = controller; }
|
||||||
this.setProperties({ style: null, loading: false });
|
this.setProperties({ style: ''.htmlSafe(), loading: false });
|
||||||
|
|
||||||
const cloaks = target && (target instanceof Placeholder) ? target.viewName : this.get('cloaks');
|
const cloaks = target && (target instanceof Placeholder) ? target.viewName : this.get('cloaks');
|
||||||
this.setContainedView(this.createChildView(cloaks, createArgs));
|
this.setContainedView(this.createChildView(cloaks, createArgs));
|
||||||
|
|
|
@ -327,6 +327,7 @@ const PostView = Discourse.GroupedView.extend(Ember.Evented, {
|
||||||
// Find all the quotes
|
// Find all the quotes
|
||||||
Em.run.scheduleOnce('afterRender', this, '_insertQuoteControls');
|
Em.run.scheduleOnce('afterRender', this, '_insertQuoteControls');
|
||||||
|
|
||||||
|
$post.closest('.post-cloak').attr('data-post-number', postNumber);
|
||||||
this._applySearchHighlight();
|
this._applySearchHighlight();
|
||||||
}.on('didInsertElement'),
|
}.on('didInsertElement'),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user