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

Commit af99edf

Browse files
committedAug 8, 2017
Merge develop into master
2 parents 5b4e449 + a720871 commit af99edf

13 files changed

+52
-49
lines changed
 

‎bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitgraph.js",
3-
"version": "1.11.3",
3+
"version": "1.11.4",
44
"main": [
55
"./build/gitgraph.js",
66
"./build/gitgraph.css"

‎build/gitgraph.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ==========================================================
2-
* GitGraph v1.11.3
2+
* GitGraph v1.11.4
33
* https://github.com/nicoespeon/gitgraph.js
44
* ==========================================================
55
* Copyright (c) 2017 Nicolas CARLO (@nicoespeon) ٩(^‿^)۶
@@ -683,7 +683,13 @@
683683
this.template.commit.color ||
684684
this.template.colors[columnIndex];
685685
options.parent = this.parent;
686-
options.parentCommit = options.parentCommit || _getParentCommitFromBranch(this);
686+
687+
// Set parentCommit
688+
// If there is commit in this branch, set parentCommit to last commit of this branch
689+
// otherwise, set parentCommit to this.parentCommit, the start point of this branch
690+
if (!options.parentCommit) {
691+
options.parentCommit = _getLast(this.commits) || this.parentCommit;
692+
}
687693

688694
// Special compact mode
689695
if (this.parent.mode === "compact" &&
@@ -739,11 +745,6 @@
739745
options.y = this.offsetY - this.parent.commitOffsetY;
740746
}
741747

742-
// Fork case: Parent commit from parent branch
743-
if (options.parentCommit instanceof Commit === false && this.parentBranch instanceof Branch) {
744-
options.parentCommit = this.parentCommit;
745-
}
746-
747748
// First commit
748749
var isFirstBranch = !(options.parentCommit instanceof Commit);
749750
var isPathBeginning = this.path.length === 0;
@@ -935,8 +936,8 @@
935936

936937
var detailOffsetY = 0;
937938

938-
if(commitOptions.detail) {
939-
if(this.parent.orientation === "vertical") {
939+
if (commitOptions.detail) {
940+
if (this.parent.orientation === "vertical") {
940941
detailOffsetY = -1 * commitOptions.detail.clientHeight;
941942
} else if (this.parent.orientation === "vertical-reverse") {
942943
detailOffsetY = commitOptions.detail.clientHeight;

‎build/gitgraph.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/Branch.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ <h5>This:</h5>
672672

673673
<dt class="tag-source">Source:</dt>
674674
<dd class="tag-source"><ul class="dummy"><li>
675-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line971">line 971</a>
675+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line972">line 972</a>
676676
</li></ul></dd>
677677

678678

@@ -757,7 +757,7 @@ <h5>This:</h5>
757757

758758
<dt class="tag-source">Source:</dt>
759759
<dd class="tag-source"><ul class="dummy"><li>
760-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line839">line 839</a>
760+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line840">line 840</a>
761761
</li></ul></dd>
762762

763763

@@ -1059,7 +1059,7 @@ <h5>This:</h5>
10591059

10601060
<dt class="tag-source">Source:</dt>
10611061
<dd class="tag-source"><ul class="dummy"><li>
1062-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line848">line 848</a>
1062+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line849">line 849</a>
10631063
</li></ul></dd>
10641064

10651065

@@ -1322,7 +1322,7 @@ <h6>Properties</h6>
13221322

13231323
<dt class="tag-source">Source:</dt>
13241324
<dd class="tag-source"><ul class="dummy"><li>
1325-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line864">line 864</a>
1325+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line865">line 865</a>
13261326
</li></ul></dd>
13271327

13281328

@@ -1437,7 +1437,7 @@ <h5>This:</h5>
14371437

14381438
<dt class="tag-source">Source:</dt>
14391439
<dd class="tag-source"><ul class="dummy"><li>
1440-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line996">line 996</a>
1440+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line997">line 997</a>
14411441
</li></ul></dd>
14421442

14431443

@@ -1831,7 +1831,7 @@ <h6>Properties</h6>
18311831

18321832
<dt class="tag-source">Source:</dt>
18331833
<dd class="tag-source"><ul class="dummy"><li>
1834-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line815">line 815</a>
1834+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line816">line 816</a>
18351835
</li></ul></dd>
18361836

18371837

@@ -1886,7 +1886,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
18861886
<br class="clear">
18871887

18881888
<footer>
1889-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Jun 13 2017 21:41:57 GMT+0200 (CEST)
1889+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 08 2017 22:31:31 GMT+0200 (CEST)
18901890
</footer>
18911891

18921892
<script> prettyPrint(); </script>

‎docs/Commit.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ <h6>Properties</h6>
13871387

13881388
<dt class="tag-source">Source:</dt>
13891389
<dd class="tag-source"><ul class="dummy"><li>
1390-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1071">line 1071</a>
1390+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1072">line 1072</a>
13911391
</li></ul></dd>
13921392

13931393

@@ -1490,7 +1490,7 @@ <h5>This:</h5>
14901490

14911491
<dt class="tag-source">Source:</dt>
14921492
<dd class="tag-source"><ul class="dummy"><li>
1493-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1231">line 1231</a>
1493+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1232">line 1232</a>
14941494
</li></ul></dd>
14951495

14961496

@@ -1575,7 +1575,7 @@ <h5>This:</h5>
15751575

15761576
<dt class="tag-source">Source:</dt>
15771577
<dd class="tag-source"><ul class="dummy"><li>
1578-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1120">line 1120</a>
1578+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1121">line 1121</a>
15791579
</li></ul></dd>
15801580

15811581

@@ -1623,7 +1623,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
16231623
<br class="clear">
16241624

16251625
<footer>
1626-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Jun 13 2017 21:41:57 GMT+0200 (CEST)
1626+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 08 2017 22:31:31 GMT+0200 (CEST)
16271627
</footer>
16281628

16291629
<script> prettyPrint(); </script>

‎docs/GitGraph.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
20612061
<br class="clear">
20622062

20632063
<footer>
2064-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Jun 13 2017 21:41:57 GMT+0200 (CEST)
2064+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 08 2017 22:31:31 GMT+0200 (CEST)
20652065
</footer>
20662066

20672067
<script> prettyPrint(); </script>

‎docs/Tag.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ <h6>Properties</h6>
294294

295295
<dt class="tag-source">Source:</dt>
296296
<dd class="tag-source"><ul class="dummy"><li>
297-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1319">line 1319</a>
297+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1320">line 1320</a>
298298
</li></ul></dd>
299299

300300

@@ -374,7 +374,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
374374
<br class="clear">
375375

376376
<footer>
377-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Jun 13 2017 21:41:57 GMT+0200 (CEST)
377+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 08 2017 22:31:31 GMT+0200 (CEST)
378378
</footer>
379379

380380
<script> prettyPrint(); </script>

‎docs/Template.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ <h6>Properties</h6>
11801180

11811181
<dt class="tag-source">Source:</dt>
11821182
<dd class="tag-source"><ul class="dummy"><li>
1183-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1394">line 1394</a>
1183+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1395">line 1395</a>
11841184
</li></ul></dd>
11851185

11861186

@@ -1329,7 +1329,7 @@ <h5>Parameters:</h5>
13291329

13301330
<dt class="tag-source">Source:</dt>
13311331
<dd class="tag-source"><ul class="dummy"><li>
1332-
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1482">line 1482</a>
1332+
<a href="gitgraph.js.html">gitgraph.js</a>, <a href="gitgraph.js.html#line1483">line 1483</a>
13331333
</li></ul></dd>
13341334

13351335

@@ -1399,7 +1399,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
13991399
<br class="clear">
14001400

14011401
<footer>
1402-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Jun 13 2017 21:41:57 GMT+0200 (CEST)
1402+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 08 2017 22:31:31 GMT+0200 (CEST)
14031403
</footer>
14041404

14051405
<script> prettyPrint(); </script>

‎docs/gitgraph.js.html

+10-9
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,13 @@ <h1 class="page-title">Source: gitgraph.js</h1>
701701
this.template.commit.color ||
702702
this.template.colors[columnIndex];
703703
options.parent = this.parent;
704-
options.parentCommit = options.parentCommit || _getParentCommitFromBranch(this);
704+
705+
// Set parentCommit
706+
// If there is commit in this branch, set parentCommit to last commit of this branch
707+
// otherwise, set parentCommit to this.parentCommit, the start point of this branch
708+
if (!options.parentCommit) {
709+
options.parentCommit = _getLast(this.commits) || this.parentCommit;
710+
}
705711

706712
// Special compact mode
707713
if (this.parent.mode === "compact" &amp;&amp;
@@ -757,11 +763,6 @@ <h1 class="page-title">Source: gitgraph.js</h1>
757763
options.y = this.offsetY - this.parent.commitOffsetY;
758764
}
759765

760-
// Fork case: Parent commit from parent branch
761-
if (options.parentCommit instanceof Commit === false &amp;&amp; this.parentBranch instanceof Branch) {
762-
options.parentCommit = this.parentCommit;
763-
}
764-
765766
// First commit
766767
var isFirstBranch = !(options.parentCommit instanceof Commit);
767768
var isPathBeginning = this.path.length === 0;
@@ -953,8 +954,8 @@ <h1 class="page-title">Source: gitgraph.js</h1>
953954

954955
var detailOffsetY = 0;
955956

956-
if(commitOptions.detail) {
957-
if(this.parent.orientation === "vertical") {
957+
if (commitOptions.detail) {
958+
if (this.parent.orientation === "vertical") {
958959
detailOffsetY = -1 * commitOptions.detail.clientHeight;
959960
} else if (this.parent.orientation === "vertical-reverse") {
960961
detailOffsetY = commitOptions.detail.clientHeight;
@@ -1880,7 +1881,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
18801881
<br class="clear">
18811882

18821883
<footer>
1883-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Jun 13 2017 21:41:57 GMT+0200 (CEST)
1884+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 08 2017 22:31:31 GMT+0200 (CEST)
18841885
</footer>
18851886

18861887
<script> prettyPrint(); </script>

‎docs/global.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
15141514
<br class="clear">
15151515

15161516
<footer>
1517-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Jun 13 2017 21:41:57 GMT+0200 (CEST)
1517+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 08 2017 22:31:31 GMT+0200 (CEST)
15181518
</footer>
15191519

15201520
<script> prettyPrint(); </script>

‎docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.ht
115115
<br class="clear">
116116

117117
<footer>
118-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Jun 13 2017 21:41:57 GMT+0200 (CEST)
118+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 08 2017 22:31:31 GMT+0200 (CEST)
119119
</footer>
120120

121121
<script> prettyPrint(); </script>

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitgraph.js",
3-
"version": "1.11.3",
3+
"version": "1.11.4",
44
"author": "Nicolas Carlo <nicolascarlo.espeon@gmail.com>",
55
"description": "A JavaScript library to draw pretty git graphs in the browser",
66
"contributors": [

‎src/gitgraph.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,13 @@
673673
this.template.commit.color ||
674674
this.template.colors[columnIndex];
675675
options.parent = this.parent;
676-
options.parentCommit = options.parentCommit || _getParentCommitFromBranch(this);
676+
677+
// Set parentCommit
678+
// If there is commit in this branch, set parentCommit to last commit of this branch
679+
// otherwise, set parentCommit to this.parentCommit, the start point of this branch
680+
if (!options.parentCommit) {
681+
options.parentCommit = _getLast(this.commits) || this.parentCommit;
682+
}
677683

678684
// Special compact mode
679685
if (this.parent.mode === "compact" &&
@@ -729,11 +735,6 @@
729735
options.y = this.offsetY - this.parent.commitOffsetY;
730736
}
731737

732-
// Fork case: Parent commit from parent branch
733-
if (options.parentCommit instanceof Commit === false && this.parentBranch instanceof Branch) {
734-
options.parentCommit = this.parentCommit;
735-
}
736-
737738
// First commit
738739
var isFirstBranch = !(options.parentCommit instanceof Commit);
739740
var isPathBeginning = this.path.length === 0;
@@ -925,8 +926,8 @@
925926

926927
var detailOffsetY = 0;
927928

928-
if(commitOptions.detail) {
929-
if(this.parent.orientation === "vertical") {
929+
if (commitOptions.detail) {
930+
if (this.parent.orientation === "vertical") {
930931
detailOffsetY = -1 * commitOptions.detail.clientHeight;
931932
} else if (this.parent.orientation === "vertical-reverse") {
932933
detailOffsetY = commitOptions.detail.clientHeight;

0 commit comments

Comments
 (0)