From c880b72fa6a0d3b805c2f62335d7174e18c84cf4 Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Thu, 4 Apr 2024 17:06:22 +0530 Subject: [PATCH 1/6] fix: bar not resizable if <1 unit --- src/bar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bar.js b/src/bar.js index 5d38a86..790fd2c 100644 --- a/src/bar.js +++ b/src/bar.js @@ -262,7 +262,7 @@ export default class Bar { } this.update_attr(bar, 'x', x); } - if (width && width >= this.gantt.options.column_width) { + if (width) { this.update_attr(bar, 'width', width); } this.update_label_position(); From d88610022192f3a6a286ba74da86e5ef2b938876 Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Thu, 4 Apr 2024 17:08:48 +0530 Subject: [PATCH 2/6] fix: all text not selectable, add safari support --- src/gantt.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gantt.scss b/src/gantt.scss index 0034e78..ebb6a90 100644 --- a/src/gantt.scss +++ b/src/gantt.scss @@ -14,6 +14,9 @@ $handle-color: #ddd !default; $light-blue: #c4c4e9 !default; .gantt { + user-select: none; + -webkit-user-select: none; + .grid-background { fill: none; } @@ -69,7 +72,6 @@ $light-blue: #c4c4e9 !default; stroke: $bar-stroke; stroke-width: 0; transition: stroke-width .3s ease; - user-select: none; } .bar-progress { fill: $blue; From 6e2f91db25d8c19f4f88eb9db5fb955573c0ce3a Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Thu, 4 Apr 2024 17:11:13 +0530 Subject: [PATCH 3/6] fix: first date disappearing --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 1da08d0..a09a786 100644 --- a/src/index.js +++ b/src/index.js @@ -526,7 +526,7 @@ export default class Gantt { get_date_info(date, last_date, i) { if (!last_date) { - last_date = date_utils.add(date, 1, 'year'); + last_date = date_utils.add(date, 1, 'day'); } const date_text = { 'Quarter Day_lower': date_utils.format( From 218818619c974ca8f2f29bed2d7c2e95da516834 Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Thu, 4 Apr 2024 17:16:02 +0530 Subject: [PATCH 4/6] fix: progress polygon when progress = 0 --- src/bar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bar.js b/src/bar.js index 790fd2c..41fbc1f 100644 --- a/src/bar.js +++ b/src/bar.js @@ -174,7 +174,7 @@ export default class Bar { append_to: this.handle_group, }); - if (this.task.progress && this.task.progress < 100) { + if (this.task.progress < 100) { this.$handle_progress = createSVG('polygon', { points: this.get_progress_polygon_points().join(','), class: 'handle progress', From 0cc5a3cbf60b3e805f92b7548f504aa96defedde Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Thu, 4 Apr 2024 17:36:38 +0530 Subject: [PATCH 5/6] fix: inconsistent time display --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index a09a786..46b29b5 100644 --- a/src/index.js +++ b/src/index.js @@ -588,10 +588,10 @@ export default class Gantt { }; const x_pos = { - 'Quarter Day_lower': (this.options.column_width * 4) / 2, - 'Quarter Day_upper': 0, - 'Half Day_lower': (this.options.column_width * 2) / 2, - 'Half Day_upper': 0, + 'Quarter Day_lower': 0, + 'Quarter Day_upper': this.options.column_width * 2, + 'Half Day_lower': 0, + 'Half Day_upper': this.options.column_width, Day_lower: this.options.column_width / 2, Day_upper: (this.options.column_width * 30) / 2, Week_lower: 0, From 7670d136342a5b824614d053b42666aaf02d4548 Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Thu, 4 Apr 2024 17:39:33 +0530 Subject: [PATCH 6/6] fix: cut off starts --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 46b29b5..5039c7c 100644 --- a/src/index.js +++ b/src/index.js @@ -588,9 +588,9 @@ export default class Gantt { }; const x_pos = { - 'Quarter Day_lower': 0, + 'Quarter Day_lower': this.options.column_width / 2, 'Quarter Day_upper': this.options.column_width * 2, - 'Half Day_lower': 0, + 'Half Day_lower': this.options.column_width / 2, 'Half Day_upper': this.options.column_width, Day_lower: this.options.column_width / 2, Day_upper: (this.options.column_width * 30) / 2,