mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 19:11:14 +08:00
FIX: Remove the old poll view before replacing it
This commit is contained in:
@ -88,8 +88,16 @@ function initializePolls(api) {
|
|||||||
votes[pollName]
|
votes[pollName]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Destroy a poll view if we're replacing it
|
||||||
|
if (_pollViews && _pollViews[pollId]) {
|
||||||
|
_pollViews[pollId].destroy();
|
||||||
|
}
|
||||||
|
|
||||||
$poll.replaceWith($div);
|
$poll.replaceWith($div);
|
||||||
Em.run.schedule('afterRender', () => pollComponent.renderer.appendTo(pollComponent, $div[0]));
|
Ember.run.scheduleOnce('afterRender', () => {
|
||||||
|
pollComponent.renderer.appendTo(pollComponent, $div[0]);
|
||||||
|
});
|
||||||
|
|
||||||
postPollViews[pollId] = pollComponent;
|
postPollViews[pollId] = pollComponent;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user