Skip to content

Commit

Permalink
Show tooltip when hovering issues on Gantt.
Browse files Browse the repository at this point in the history
  • Loading branch information
kulesa committed Aug 16, 2013
1 parent aca8552 commit 838bbb2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 51 deletions.
14 changes: 7 additions & 7 deletions assets/javascripts/raphael.arrow.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This plugin draws arrows on Redmine gantt chart.
###

# Draws an arrow
# Draws an arrow
# Original here: http://taitems.tumblr.com/post/549973287/drawing-arrows-in-raphaeljs
Raphael.fn.ganttArrow = (coords, relationType = "follows") ->
# Strokes for relation types
Expand All @@ -11,7 +11,7 @@ Raphael.fn.ganttArrow = (coords, relationType = "follows") ->
"duplicated": "- "
"blocked": "-"
"relates": "."

# Shorthand functions for formatting SVG commands
cmd = (cmd, a...) -> cmd.concat(" ", a.join(" "), " ")
M = (x, y) -> cmd("M", x, y)
Expand All @@ -30,13 +30,13 @@ Raphael.fn.ganttArrow = (coords, relationType = "follows") ->
x1 += 3

arrow = @set()

deltaX = 7
deltaY = 8

[x2, y2] = [x1 + deltaX - 3, y1]
[x5, y5] = [x6 - deltaX, y6]

if y1 < y6
[x3, y3] = [x2, y6 - deltaY]
else
Expand All @@ -63,11 +63,11 @@ window.redrawGanttArrows = () ->
paper.clear
window.paper = paper
paper.canvas.style.position = "absolute"
paper.canvas.style.zIndex = "50"
paper.canvas.style.zIndex = "24"

# Relation attributes
relationAttrs = ["follows", "blocked", "duplicated", "relates"]

# Calculates arrow coordinates
calculateAnchors = (from, to) ->
[fromOffsetX, fromOffsetY] = [from.position().left, from.position().top]
Expand Down
66 changes: 22 additions & 44 deletions assets/javascripts/raphael.arrow.js

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

0 comments on commit 838bbb2

Please sign in to comment.