We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 05b54a0 + 1ce865c commit 1e4b122Copy full SHA for 1e4b122
lib/rails_charts/base_chart.rb
@@ -80,6 +80,11 @@ def js_code
80
window.addEventListener('turbo:load', init_#{chart_id});
81
window.addEventListener('turbolinks:load', init_#{chart_id});
82
83
+ window.addEventListener('turbo:frame-render', init_#{chart_id});
84
+ window.addEventListener('turbo:frame-load', ()=> {
85
+ window.removeEventListener('turbo:frame-render', init_#{chart_id});
86
+ });
87
+
88
document.addEventListener("turbolinks:before-render", destroy_#{chart_id});
89
document.addEventListener("turbo:before-render", destroy_#{chart_id});
90
</script>
0 commit comments