Skip to content

Commit

Permalink
Fix for Turbo [Closes ankane#608]
Browse files Browse the repository at this point in the history
  • Loading branch information
wilg authored and shawn-oilcan committed Dec 4, 2024
1 parent b07c7d5 commit 7a5cd40
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/chartkick/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def chartkick_chart(klass, data_source, **options)
var createChart = function() { #{createjs} };
if ("Chartkick" in window) {
createChart();
window.addEventListener("turbo:load", createChart, {once: true});
} else {
window.addEventListener("chartkick:load", createChart, true);
}
Expand Down

0 comments on commit 7a5cd40

Please sign in to comment.