mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
FIX: Posts weren't cloaking properly
This commit is contained in:
parent
0c2a54dbb5
commit
76aa651ad4
@ -2,6 +2,7 @@ import { createWidget } from 'discourse/widgets/widget';
|
||||
import transformPost from 'discourse/lib/transform-post';
|
||||
import { Placeholder } from 'discourse/lib/posts-with-placeholders';
|
||||
import { addWidgetCleanCallback } from 'discourse/components/mount-widget';
|
||||
import { keyDirty } from 'discourse/widgets/widget';
|
||||
|
||||
let transformCallbacks = null;
|
||||
function postTransformCallbacks(transformed) {
|
||||
@ -35,12 +36,14 @@ export function cloak(post, component) {
|
||||
const $post = $(`#post_${post.post_number}`);
|
||||
_cloaked[post.id] = true;
|
||||
_heights[post.id] = $post.outerHeight();
|
||||
keyDirty(`post-${post.id}`);
|
||||
Ember.run.debounce(component, 'queueRerender', 1000);
|
||||
}
|
||||
|
||||
export function uncloak(post, component) {
|
||||
if (!CLOAKING_ENABLED || !_cloaked[post.id]) { return; }
|
||||
_cloaked[post.id] = null;
|
||||
keyDirty(`post-${post.id}`);
|
||||
component.queueRerender();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user