FIX: When cloaked, posts would break jumping to top/bottom

This commit is contained in:
Robin Ward 2016-02-29 11:31:30 -05:00
parent ad3a58b171
commit ff31403a60
2 changed files with 6 additions and 4 deletions

View File

@ -76,7 +76,7 @@ const DiscourseURL = Ember.Object.createWithMixins({
},
// Scroll to the same page, different anchor
scrollToId: function(id) {
scrollToId(id) {
if (Em.isEmpty(id)) { return; }
_jumpScheduled = true;

View File

@ -379,9 +379,11 @@ export default createWidget('post', {
shadowTree: true,
buildAttributes(attrs) {
if (attrs.cloaked) {
return { style: `height: ${attrs.height}px` };
}
return attrs.cloaked ? { style: `height: ${attrs.height}px` } : undefined;
},
buildId(attrs) {
return attrs.cloaked ? `post_${attrs.post_number}` : undefined;
},
buildClasses(attrs) {