// Based on jQuery.ganttView v.0.8.8 Copyright (c) 2010 JC Grubbs - jc.grubbs@devmynd.com - MIT License Kanboard.Gantt = function(app) { this.app = app; this.data = []; this.options = { container: "#gantt-chart", showWeekends: true, allowMoves: true, allowResizes: true, cellWidth: 21, cellHeight: 31, slideWidth: 1000, vHeaderWidth: 200 }; }; Kanboard.Gantt.prototype.execute = function() { if (this.app.hasId("gantt-chart")) { this.show(); } }; // Save record after a resize or move Kanboard.Gantt.prototype.saveRecord = function(record) { this.app.showLoadingIcon(); $.ajax({ cache: false, url: $(this.options.container).data("save-url"), contentType: "application/json", type: "POST", processData: false, data: JSON.stringify(record), complete: this.app.hideLoadingIcon.bind(this) }); }; // Build the Gantt chart Kanboard.Gantt.prototype.show = function() { this.data = this.prepareData($(this.options.container).data('records')); var minDays = Math.floor((this.options.slideWidth / this.options.cellWidth) + 5); var range = this.getDateRange(minDays); var startDate = range[0]; var endDate = range[1]; var container = $(this.options.container); var chart = jQuery("
" + $(this.options.container).data("label-" + type) + "
" + list[0].outerHTML; } } } return tooltip; }; // Get tooltip for bars Kanboard.Gantt.prototype.getBarTooltip = function(record) { var tooltip = ""; if (record.not_defined) { tooltip = $(this.options.container).data("label-not-defined"); } else { if (record.type == "task") { tooltip = "" + record.progress + "