mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 11:10:57 +01:00
a click handler to allow finding the commits a line connects
This commit is contained in:
@@ -17,5 +17,6 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -237,7 +237,9 @@ $( function() {
|
|||||||
lineLane.centerX, 0) )
|
lineLane.centerX, 0) )
|
||||||
.attr({
|
.attr({
|
||||||
stroke: lineLane.color, "stroke-width": 2
|
stroke: lineLane.color, "stroke-width": 2
|
||||||
}).toBack();
|
})
|
||||||
|
.data('theCommit', commit).data('theChild', thisChild).click(lineClickHandler)
|
||||||
|
.toBack();
|
||||||
|
|
||||||
while( nRow.length > 0 ) {
|
while( nRow.length > 0 ) {
|
||||||
|
|
||||||
@@ -250,17 +252,23 @@ $( function() {
|
|||||||
thisChild.lane.centerX, cfg.rowHeight/2) )
|
thisChild.lane.centerX, cfg.rowHeight/2) )
|
||||||
.attr({
|
.attr({
|
||||||
stroke: lineLane.color, "stroke-width": 2
|
stroke: lineLane.color, "stroke-width": 2
|
||||||
}).toBack();
|
})
|
||||||
|
.data('theCommit', commit).data('theChild', thisChild).click(lineClickHandler)
|
||||||
|
.toBack();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// this is just a common "throughput" line part from bottom of the TR to top without any X movement
|
// this is just a common "throughput" line part from bottom of the TR to top without any X movement
|
||||||
|
//
|
||||||
|
// maybe the paper isn't big enough yet, so expand it first...
|
||||||
nRow.data('rjsPaper')
|
nRow.data('rjsPaper')
|
||||||
.path(
|
.path(
|
||||||
getSvgLineString( lineLane.centerX, 0,
|
getSvgLineString( lineLane.centerX, 0,
|
||||||
lineLane.centerX, cfg.rowHeight) )
|
lineLane.centerX, cfg.rowHeight) )
|
||||||
.attr({
|
.attr({
|
||||||
stroke: lineLane.color, "stroke-width": 2
|
stroke: lineLane.color, "stroke-width": 2
|
||||||
}).toBack();
|
})
|
||||||
|
.data('theCommit', commit).data('theChild', thisChild).click(lineClickHandler)
|
||||||
|
.toBack();
|
||||||
nRow = nRow.prev('tr');
|
nRow = nRow.prev('tr');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -271,6 +279,21 @@ $( function() {
|
|||||||
return 'M' + fromX + ',' + fromY + 'L' + toX + ',' + toY;
|
return 'M' + fromX + ',' + fromY + 'L' + toX + ',' + toY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lineClickHandler(evt) {
|
||||||
|
console.log('Hi, I am connecting', this.data('theCommit'), 'with', this.data('theChild'));
|
||||||
|
|
||||||
|
flashDot( this.data('theCommit').dot );
|
||||||
|
flashDot( this.data('theChild').dot );
|
||||||
|
}
|
||||||
|
|
||||||
|
function flashDot( dot ) {
|
||||||
|
var origCol = dot.attr('fill');
|
||||||
|
dot.attr('fill', '#00FF00');
|
||||||
|
dot.animate( {
|
||||||
|
'fill': origCol
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
function dotClickHandler(evt) {
|
function dotClickHandler(evt) {
|
||||||
console.log(this.data('commit'));
|
console.log(this.data('commit'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user