mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 13:05:31 +08:00
FIX: Remove the old poll view before replacing it
This commit is contained in:
parent
dafd1453d6
commit
ffae39912f
|
@ -88,8 +88,16 @@ function initializePolls(api) {
|
|||
votes[pollName]
|
||||
);
|
||||
|
||||
// Destroy a poll view if we're replacing it
|
||||
if (_pollViews && _pollViews[pollId]) {
|
||||
_pollViews[pollId].destroy();
|
||||
}
|
||||
|
||||
$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;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user