FIX: Jump to previously loaded post was broken

This commit is contained in:
Robin Ward 2015-12-04 16:20:43 -05:00
parent 6d38640645
commit 63ba6c78af
3 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@ const DiscourseURL = Ember.Object.createWithMixins({
Jumps to a particular post in the stream
**/
jumpToPost: function(postNumber, opts) {
const holderId = `#post_${postNumber}`;
const holderId = `.post-cloak[data-post-number=${postNumber}]`;
const offset = function() {
const $header = $('header');

View File

@ -96,7 +96,7 @@ export default Ember.View.extend({
createArgs.context = target;
}
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');
this.setContainedView(this.createChildView(cloaks, createArgs));

View File

@ -327,6 +327,7 @@ const PostView = Discourse.GroupedView.extend(Ember.Evented, {
// Find all the quotes
Em.run.scheduleOnce('afterRender', this, '_insertQuoteControls');
$post.closest('.post-cloak').attr('data-post-number', postNumber);
this._applySearchHighlight();
}.on('didInsertElement'),