mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
Click handler for the commit dots
This commit is contained in:
@@ -43,11 +43,15 @@ class NetworkController implements ControllerProviderInterface
|
|||||||
$jsonFormattedCommits = array();
|
$jsonFormattedCommits = array();
|
||||||
|
|
||||||
foreach( $commits as $commit ) {
|
foreach( $commits as $commit ) {
|
||||||
|
$detailsUrl = $app['url_generator']->generate('commit', array( 'repo' => $repo,
|
||||||
|
'commit'=>$commit->getHash()));
|
||||||
|
|
||||||
$jsonFormattedCommits[$commit->getHash()] = array(
|
$jsonFormattedCommits[$commit->getHash()] = array(
|
||||||
'hash' => $commit->getHash(),
|
'hash' => $commit->getHash(),
|
||||||
'parentsHash' => $commit->getParentsHash(),
|
'parentsHash' => $commit->getParentsHash(),
|
||||||
'date' => $commit->getDate()->format('U'),
|
'date' => $commit->getDate()->format('U'),
|
||||||
'message' => htmlentities( $commit->getMessage() ),
|
'message' => htmlentities( $commit->getMessage() ),
|
||||||
|
'details' => $detailsUrl,
|
||||||
'author' => array(
|
'author' => array(
|
||||||
'name' => $commit->getAuthor()->getName(),
|
'name' => $commit->getAuthor()->getName(),
|
||||||
'email' => $commit->getAuthor()->getEmail(),
|
'email' => $commit->getAuthor()->getEmail(),
|
||||||
|
|||||||
@@ -465,7 +465,8 @@
|
|||||||
})
|
})
|
||||||
.data('commit', commit)
|
.data('commit', commit)
|
||||||
.mouseover( handleCommitMouseover )
|
.mouseover( handleCommitMouseover )
|
||||||
.mouseout( handleCommitMouseout);
|
.mouseout( handleCommitMouseout )
|
||||||
|
.click( handleCommitClick );
|
||||||
|
|
||||||
$.each( commit.children, function ( idx, thisChild ) {
|
$.each( commit.children, function ( idx, thisChild ) {
|
||||||
|
|
||||||
@@ -539,6 +540,10 @@
|
|||||||
detailOverlay.hide();
|
detailOverlay.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleCommitClick( evt ) {
|
||||||
|
window.open( this.data('commit').details );
|
||||||
|
}
|
||||||
|
|
||||||
function getXPositionForColumnNumber( columnNumber ) {
|
function getXPositionForColumnNumber( columnNumber ) {
|
||||||
// we want the column's center point
|
// we want the column's center point
|
||||||
return ( paper.width - ( columnNumber * cfg.columnWidth ) + (cfg.columnWidth / 2 ));
|
return ( paper.width - ( columnNumber * cfg.columnWidth ) + (cfg.columnWidth / 2 ));
|
||||||
|
|||||||
Reference in New Issue
Block a user