Skip to content

Commit 1afeb59

Browse files
author
Alex Corre
committed
Merge branch 'master' into develop
2 parents 45e1473 + ceacb5a commit 1afeb59

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/views/blame-line-view.coffee

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RP = React.PropTypes
66
moment = require 'moment'
77
{formatDate} = require '../util/blameFormatter'
88
errorController = require '../controllers/errorController'
9+
shell = require 'shell'
910

1011
HASH_LENGTH = 7 # github uses this length
1112
BLANK_HASH = '-'.repeat(HASH_LENGTH)
@@ -46,7 +47,7 @@ BlameLineComponent = React.createClass
4647
a onClick: @didClickHashWithoutUrl, className: 'hash', @props.hash.substring(0, HASH_LENGTH)
4748
else
4849
url = @props.remoteRevision.url @props.hash
49-
a href: url, target: '_blank', className: 'hash', @props.hash.substring(0, HASH_LENGTH)
50+
a href: '#', 'data-url': url, className: 'hash', @props.hash.substring(0, HASH_LENGTH)
5051
span className: 'date', @props.date
5152
span className: 'committer text-highlight',
5253
if @props.showOnlyLastNames
@@ -56,12 +57,16 @@ BlameLineComponent = React.createClass
5657

5758
componentDidMount: ->
5859
$el = $(@getDOMNode())
60+
$('a', $el).click @didClickHashWithUrl
5961
if @props.summary
6062
atom.tooltips.add($el,
6163
title: @props.summary
6264
placement: "auto left"
6365
)
6466

67+
didClickHashWithUrl: (e) ->
68+
e.preventDefault()
69+
shell.openExternal(e.target.getAttribute('data-url'))
6570

6671
componentWillUnmount: ->
6772
$el = $(@getDOMNode())

0 commit comments

Comments
 (0)