mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: Remove the old poll view before replacing it
This commit is contained in:
parent
dafd1453d6
commit
ffae39912f
1 changed files with 9 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue