Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
Merge develop into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoespeon committed Sep 1, 2016
2 parents 421c5c5 + 52efb85 commit 3fc6fc2
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 34 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gitgraph.js",
"version": "1.3.0",
"version": "1.3.1",
"main": [ "./build/gitgraph.js", "./build/gitgraph.css" ],
"ignore": [
"**/.*"
Expand Down
16 changes: 13 additions & 3 deletions build/gitgraph.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ==========================================================
* GitGraph v1.3.0
* GitGraph v1.3.1
* https://github.com/nicoespeon/gitgraph.js
* ==========================================================
* Copyright (c) 2016 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶
Expand Down Expand Up @@ -384,8 +384,18 @@
**/
GitGraph.prototype.applyCommits = function ( event, callbackFn ) {
// Fallback onto layerX/layerY for older versions of Firefox.
var offsetX = event.offsetX || event.layerX;
var offsetY = event.offsetY || event.layerY;
function getOffsetById ( id ) {
var el = document.getElementById( id );
var rect = el.getBoundingClientRect();

return {
top: rect.top + document.body.scrollTop,
left: rect.left + document.body.scrollLeft
};
}

var offsetX = event.offsetX || (event.pageX - getOffsetById( this.elementId ).left);
var offsetY = event.offsetY || (event.pageY - getOffsetById( this.elementId ).top);

for ( var i = 0, commit; !!(commit = this.commits[ i ]); i++ ) {
var distanceX = (commit.x + (this.offsetX + this.marginX) / this.scalingFactor - offsetX);
Expand Down
4 changes: 2 additions & 2 deletions build/gitgraph.min.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions docs/Branch.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line492">line 492</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line502">line 502</a>
</li></ul></dd>


Expand Down Expand Up @@ -465,7 +465,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line581">line 581</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line591">line 591</a>
</li></ul></dd>


Expand Down Expand Up @@ -566,7 +566,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line856">line 856</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line866">line 866</a>
</li></ul></dd>


Expand Down Expand Up @@ -638,7 +638,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line776">line 776</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line786">line 786</a>
</li></ul></dd>


Expand Down Expand Up @@ -833,7 +833,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line655">line 655</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line665">line 665</a>
</li></ul></dd>


Expand Down Expand Up @@ -912,7 +912,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line785">line 785</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line795">line 795</a>
</li></ul></dd>


Expand Down Expand Up @@ -1092,7 +1092,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line799">line 799</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line809">line 809</a>
</li></ul></dd>


Expand Down Expand Up @@ -1187,7 +1187,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line881">line 881</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line891">line 891</a>
</li></ul></dd>


Expand Down Expand Up @@ -1259,7 +1259,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line606">line 606</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line616">line 616</a>
</li></ul></dd>


Expand Down Expand Up @@ -1306,7 +1306,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Aug 08 2016 19:11:55 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Sep 01 2016 11:56:54 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
8 changes: 4 additions & 4 deletions docs/Commit.html
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line954">line 954</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line964">line 964</a>
</li></ul></dd>


Expand Down Expand Up @@ -1386,7 +1386,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1085">line 1085</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1095">line 1095</a>
</li></ul></dd>


Expand Down Expand Up @@ -1458,7 +1458,7 @@ <h5>This:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1004">line 1004</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1014">line 1014</a>
</li></ul></dd>


Expand Down Expand Up @@ -1505,7 +1505,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Aug 08 2016 19:11:55 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Sep 01 2016 11:56:54 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
6 changes: 3 additions & 3 deletions docs/GitGraph.html
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line463">line 463</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line473">line 473</a>
</li></ul></dd>


Expand Down Expand Up @@ -1215,7 +1215,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line397">line 397</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line407">line 407</a>
</li></ul></dd>


Expand Down Expand Up @@ -1624,7 +1624,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Aug 08 2016 19:11:55 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Sep 01 2016 11:56:54 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
6 changes: 3 additions & 3 deletions docs/Template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ <h6>Properties</h6>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1201">line 1201</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1211">line 1211</a>
</li></ul></dd>


Expand Down Expand Up @@ -1228,7 +1228,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1281">line 1281</a>
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1291">line 1291</a>
</li></ul></dd>


Expand Down Expand Up @@ -1297,7 +1297,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Aug 08 2016 19:11:55 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Sep 01 2016 11:56:54 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
16 changes: 13 additions & 3 deletions docs/gitgraph.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,18 @@ <h1 class="page-title">Source: gitgraph.js</h1>
**/
GitGraph.prototype.applyCommits = function ( event, callbackFn ) {
// Fallback onto layerX/layerY for older versions of Firefox.
var offsetX = event.offsetX || event.layerX;
var offsetY = event.offsetY || event.layerY;
function getOffsetById ( id ) {
var el = document.getElementById( id );
var rect = el.getBoundingClientRect();

return {
top: rect.top + document.body.scrollTop,
left: rect.left + document.body.scrollLeft
};
}

var offsetX = event.offsetX || (event.pageX - getOffsetById( this.elementId ).left);
var offsetY = event.offsetY || (event.pageY - getOffsetById( this.elementId ).top);

for ( var i = 0, commit; !!(commit = this.commits[ i ]); i++ ) {
var distanceX = (commit.x + (this.offsetX + this.marginX) / this.scalingFactor - offsetX);
Expand Down Expand Up @@ -1430,7 +1440,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Aug 08 2016 19:11:55 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Sep 01 2016 11:56:54 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Aug 08 2016 19:11:55 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Sep 01 2016 11:56:54 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="Branch.h
<br clear="both">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Mon Aug 08 2016 19:11:55 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Thu Sep 01 2016 11:56:54 GMT+0200 (CEST)
</footer>

<script> prettyPrint(); </script>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gitgraph.js",
"version": "1.3.0",
"version": "1.3.1",
"author": "Nicolas Carlo <[email protected]>",
"description": "A JavaScript library to draw pretty git graphs in the browser",
"contributors": [
Expand Down
14 changes: 12 additions & 2 deletions src/gitgraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,18 @@
**/
GitGraph.prototype.applyCommits = function ( event, callbackFn ) {
// Fallback onto layerX/layerY for older versions of Firefox.
var offsetX = event.offsetX || event.layerX;
var offsetY = event.offsetY || event.layerY;
function getOffsetById ( id ) {
var el = document.getElementById( id );
var rect = el.getBoundingClientRect();

return {
top: rect.top + document.body.scrollTop,
left: rect.left + document.body.scrollLeft
};
}

var offsetX = event.offsetX || (event.pageX - getOffsetById( this.elementId ).left);
var offsetY = event.offsetY || (event.pageY - getOffsetById( this.elementId ).top);

for ( var i = 0, commit; !!(commit = this.commits[ i ]); i++ ) {
var distanceX = (commit.x + (this.offsetX + this.marginX) / this.scalingFactor - offsetX);
Expand Down

0 comments on commit 3fc6fc2

Please sign in to comment.