mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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]
|
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;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user