Seperate two different link

This commit is contained in:
Ephemera 2014-05-22 01:51:27 +09:00
parent 3c78703d46
commit 10bafc35d8
2 changed files with 12 additions and 3 deletions

View File

@ -122,6 +122,9 @@ html {
.octotree_treeview .jstree-anchor:hover {
text-decoration: none !important; /* Safari needs this */
}
.octotree_treeview .jstree-anchor > span {
color: black;
}
.octotree_treeview .jstree-default .jstree-wholerow {
height: auto;

View File

@ -166,8 +166,14 @@
else if (type === 'blob') item.a_attr = { href: '/' + repo.username + '/' + repo.reponame + '/' + type + '/' + repo.branch + '/' + path }
else if (type === 'commit') {
var url = submodules[item.path]
item.text = item.text + ' @ ' + item.sha.substr(0, 7)
item.a_attr = { href: ~url.indexOf('github.com') ? url.replace(/.git$/,'') + '/tree/' + item.sha : url }
if (~url.indexOf('github.com')) {
var uri = url.split('github.com')[1].substr(1).replace(/.git$/, '')
item.text = '<a href="/' + uri + '" class="jstree-anchor">' + item.text + '</a><span>@ </span><a href="/' + uri + '/tree/' + item.sha + '" class="jstree-anchor">' + item.sha.substr(0, 7) + '</a>'
}
else {
item.text = '<span>' + item.text + ' @ ' + item.sha.substr(0, 7) + '</span>'
}
item.a_attr = { href: '#', title: url + ' @ ' + item.sha }
}
})
@ -260,7 +266,7 @@
var $target = $(e.target)
if (!$target.is('a.jstree-anchor')) return
var $first = $target.children(':first')
var $first = $target.children().length !== 0 ? $target.children(':first') : $target.siblings(':first')
, href = $target.attr('href')
if ($first.hasClass('blob')) {
var container = $(GH_PJAX_SEL)