diff options
Diffstat (limited to 'app/assets/javascripts/network/raphael.js')
-rw-r--r-- | app/assets/javascripts/network/raphael.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/network/raphael.js b/app/assets/javascripts/network/raphael.js index 22e06a35d91..e13471c0e51 100644 --- a/app/assets/javascripts/network/raphael.js +++ b/app/assets/javascripts/network/raphael.js @@ -1,12 +1,14 @@ import Raphael from 'raphael/raphael'; +import { formatDate } from '~/lib/utils/datetime_utility'; Raphael.prototype.commitTooltip = function commitTooltip(x, y, commit) { const boxWidth = 300; const icon = this.image(gon.relative_url_root + commit.author.icon, x, y, 20, 20); const nameText = this.text(x + 25, y + 10, commit.author.name); - const idText = this.text(x, y + 35, commit.id); - const messageText = this.text(x, y + 50, commit.message.replace(/\r?\n/g, ' \n ')); - const textSet = this.set(icon, nameText, idText, messageText).attr({ + const dateText = this.text(x, y + 35, formatDate(commit.date)); + const idText = this.text(x, y + 55, commit.id); + const messageText = this.text(x, y + 70, commit.message.replace(/\r?\n/g, ' \n ')); + const textSet = this.set(icon, nameText, dateText, idText, messageText).attr({ 'text-anchor': 'start', font: '12px Monaco, monospace', }); @@ -14,6 +16,9 @@ Raphael.prototype.commitTooltip = function commitTooltip(x, y, commit) { font: '14px Arial', 'font-weight': 'bold', }); + dateText.attr({ + fill: '#666', + }); idText.attr({ fill: '#AAA', }); |