Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

wait until plot function is defined

ulferts7d4201e46a95
diff --git a/modules/backlogs/app/views/rb_burndown_charts/_burndown.html.erb b/modules/backlogs/app/views/rb_burndown_charts/_burndown.html.erb
index 76fd3bc9afe..9f7ba6ea68b 100644
--- a/modules/backlogs/app/views/rb_burndown_charts/_burndown.html.erb
+++ b/modules/backlogs/app/views/rb_burndown_charts/_burndown.html.erb
@@ -119,9 +119,21 @@ See docs/COPYRIGHT.rdoc for more details.
$(".burndown_chart").bind("plothover", Burndown.showTooltipOnHover);
Burndown.plotAccordingToChoices();
+ },
+
+ saveInit: function() {
+ // Ensure $.plot is defined before progressing.
+ // This static page might already be ready but the webpack required
+ // jquery.flot.js file might not be loaded yet.
+
+ if ($.plot) {
+ this.init();
+ } else {
+ setTimeout(() => { this.saveInit()}, 50);
+ }
}
};
- Burndown.init();
+ Burndown.saveInit();
});
<% end %>