FIX: When cloaked, posts would break jumping to top/bottom
This commit is contained in:
parent
ad3a58b171
commit
ff31403a60
|
@ -76,7 +76,7 @@ const DiscourseURL = Ember.Object.createWithMixins({
|
||||||
},
|
},
|
||||||
|
|
||||||
// Scroll to the same page, different anchor
|
// Scroll to the same page, different anchor
|
||||||
scrollToId: function(id) {
|
scrollToId(id) {
|
||||||
if (Em.isEmpty(id)) { return; }
|
if (Em.isEmpty(id)) { return; }
|
||||||
|
|
||||||
_jumpScheduled = true;
|
_jumpScheduled = true;
|
||||||
|
|
|
@ -379,9 +379,11 @@ export default createWidget('post', {
|
||||||
shadowTree: true,
|
shadowTree: true,
|
||||||
|
|
||||||
buildAttributes(attrs) {
|
buildAttributes(attrs) {
|
||||||
if (attrs.cloaked) {
|
return attrs.cloaked ? { style: `height: ${attrs.height}px` } : undefined;
|
||||||
return { style: `height: ${attrs.height}px` };
|
},
|
||||||
}
|
|
||||||
|
buildId(attrs) {
|
||||||
|
return attrs.cloaked ? `post_${attrs.post_number}` : undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
buildClasses(attrs) {
|
buildClasses(attrs) {
|
||||||
|
|
Loading…
Reference in New Issue