From 6c7eb0b8c7d2b9a4e0f43758b351caa3332f0846 Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Wed, 29 Oct 2025 17:59:16 +0530 Subject: [PATCH] feat: new doc on click --- .../public/js/frappe/views/gantt/gantt_view.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/frappe/public/js/frappe/views/gantt/gantt_view.js b/frappe/public/js/frappe/views/gantt/gantt_view.js index 1b84f44234..b5dec24777 100644 --- a/frappe/public/js/frappe/views/gantt/gantt_view.js +++ b/frappe/public/js/frappe/views/gantt/gantt_view.js @@ -93,20 +93,19 @@ frappe.views.GanttView = class GanttView extends frappe.views.ListView { const date_format = "YYYY-MM-DD"; this.$result.empty(); - this.$result.addClass("gantt-modern"); this.gantt = new Gantt(this.$result[0], this.tasks, { bar_height: 35, bar_corner_radius: 4, - resize_handle_width: 8, - resize_handle_height: 28, - resize_handle_corner_radius: 3, - resize_handle_offset: 4, + hover_on_date: true, view_mode: gantt_view_mode, date_format: "YYYY-MM-DD", - on_click: (task) => { + on_double_click: (task) => { frappe.set_route("Form", task.doctype, task.id); }, + on_date_click: (date) => { + if (date) frappe.new_doc("ToDo", { date: new Date(date) }); + }, on_date_change: (task, start, end) => { if (!me.can_write) return; frappe.db.set_value(task.doctype, task.id, { @@ -170,9 +169,9 @@ frappe.views.GanttView = class GanttView extends frappe.views.ListView { ${view_modes .map( (value) => `` ) .join("")}