Click handler for the commit dots

This commit is contained in:
Lukas Domnick
2013-06-08 08:49:03 +02:00
parent acaf02695b
commit 5aa290642a
2 changed files with 10 additions and 1 deletions

View File

@@ -43,11 +43,15 @@ class NetworkController implements ControllerProviderInterface
$jsonFormattedCommits = array();
foreach( $commits as $commit ) {
$detailsUrl = $app['url_generator']->generate('commit', array( 'repo' => $repo,
'commit'=>$commit->getHash()));
$jsonFormattedCommits[$commit->getHash()] = array(
'hash' => $commit->getHash(),
'parentsHash' => $commit->getParentsHash(),
'date' => $commit->getDate()->format('U'),
'message' => htmlentities( $commit->getMessage() ),
'details' => $detailsUrl,
'author' => array(
'name' => $commit->getAuthor()->getName(),
'email' => $commit->getAuthor()->getEmail(),

View File

@@ -465,7 +465,8 @@
})
.data('commit', commit)
.mouseover( handleCommitMouseover )
.mouseout( handleCommitMouseout);
.mouseout( handleCommitMouseout )
.click( handleCommitClick );
$.each( commit.children, function ( idx, thisChild ) {
@@ -539,6 +540,10 @@
detailOverlay.hide();
}
function handleCommitClick( evt ) {
window.open( this.data('commit').details );
}
function getXPositionForColumnNumber( columnNumber ) {
// we want the column's center point
return ( paper.width - ( columnNumber * cfg.columnWidth ) + (cfg.columnWidth / 2 ));