diff --git a/src/bar.js b/src/bar.js index 5d38a86..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', @@ -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(); 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; diff --git a/src/index.js b/src/index.js index 1da08d0..5039c7c 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( @@ -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': this.options.column_width / 2, + 'Quarter Day_upper': this.options.column_width * 2, + '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, Week_lower: 0,