Skip to content

Commit

Permalink
Merge pull request #499 from frappe/master
Browse files Browse the repository at this point in the history
Publish new changes
  • Loading branch information
safwansamsudeen authored Jan 23, 2025
2 parents ed89651 + b617dff commit dbf75cb
Show file tree
Hide file tree
Showing 6 changed files with 131 additions and 131 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frappe-gantt",
"version": "1.0.0",
"version": "1.0.3",
"description": "A simple, modern, interactive gantt library for the web",
"main": "src/index.js",
"type": "module",
Expand Down
183 changes: 96 additions & 87 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions src/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class Bar {
this.compute_duration();
this.corner_radius = this.gantt.options.bar_corner_radius;
this.width = this.gantt.config.column_width * this.duration;
if (this.task.progress < 0) this.task.progress = 0;
if (!this.task.progress || this.task.progress < 0) this.task.progress = 0;
if (this.task.progress > 100) this.task.progress = 100;
}

Expand Down Expand Up @@ -111,11 +111,7 @@ export default class Bar {
height: this.height,
rx: this.corner_radius,
ry: this.corner_radius,
class:
'bar' +
(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)
? ' safari'
: ''),
class: 'bar',
append_to: this.bar_group,
});
if (this.task.color) this.$bar.style.fill = this.task.color;
Expand Down Expand Up @@ -150,13 +146,16 @@ export default class Bar {
draw_progress_bar() {
if (this.invalid) return;
this.progress_width = this.calculate_progress_width();
let r = this.corner_radius;
if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent))
r = this.corner_radius + 2;
this.$bar_progress = createSVG('rect', {
x: this.x,
y: this.y,
width: this.progress_width,
height: this.height,
rx: this.corner_radius,
ry: this.corner_radius,
rx: r,
ry: r,
class: 'bar-progress',
append_to: this.bar_group,
});
Expand Down
Loading

0 comments on commit dbf75cb

Please sign in to comment.