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

Commit 07d7f7f

Browse files
author
Carlo Rivera
committed
Change messageShort to commitDotText
1 parent b698e18 commit 07d7f7f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

examples/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ var commitConfig = {
7777
dotStrokeWidth: 10,
7878
messageHashDisplay: false,
7979
messageAuthorDisplay: true,
80-
messageShort: "C1",
80+
commitDotText: "C1",
8181
message: "Alors c'est qui le papa ?",
8282
tooltipDisplay: false,
8383
author: "Me <[email protected]>"
@@ -130,7 +130,7 @@ test.merge(master, "My special merge commit message");
130130
// Then, continue committing on the "test" branch
131131
test.commit({
132132
message: "It works !",
133-
messageShort: "C2"
133+
commitDotText: "C2"
134134
});
135135

136136
var fastForwardBranch = test.branch("fast-forward");

src/gitgraph.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@
10531053
* @param {number[]} [options.lineDash = this.template.commit.dot.lineDash]
10541054
*
10551055
* @param {string} [options.message = "He doesn't like George Michael! Boooo!"] - Commit message
1056-
* @param {string} [options.message] - short commit message (A few chars) to appear on the commit dot
1056+
* @param {string} [options.commitDotText] - short commit message (A few chars) to appear on the commit dot
10571057
* @param {string} [options.messageColor = options.color] - Specific message color
10581058
* @param {string} [options.messageFont = this.template.commit.message.font] - Font of the message
10591059
* @param {boolean} [options.messageDisplay = this.template.commit.message.display] - Commit message display policy
@@ -1086,8 +1086,8 @@
10861086
this.date = options.date || new Date().toUTCString();
10871087
this.detail = options.detail || null;
10881088
this.sha1 = options.sha1 || (Math.random(100)).toString(16).substring(3, 10);
1089-
this.message = options.message || options.messageShort || "He doesn't like George Michael! Boooo!";
1090-
this.messageShort = options.messageShort;
1089+
this.message = options.message || "He doesn't like George Michael! Boooo!";
1090+
this.commitDotText = options.commitDotText;
10911091
this.arrowDisplay = options.arrowDisplay;
10921092
this.messageDisplay = _booleanOptionOr(options.messageDisplay, this.template.commit.message.display);
10931093
this.messageAuthorDisplay = _booleanOptionOr(options.messageAuthorDisplay, this.template.commit.message.displayAuthor);
@@ -1207,14 +1207,15 @@
12071207
}
12081208
}
12091209

1210-
if (this.messageShort !== undefined) {
1210+
// Commit Dot Text
1211+
if (this.commitDotText) {
12111212
var previousTextBaseline = this.context.textBaseline;
12121213
var previousTextAlign = this.context.textAlign;
12131214

12141215
this.context.fillStyle = "#000";
12151216
this.context.textAlign = "center";
12161217
this.context.textBaseline = 'middle';
1217-
this.context.fillText(this.messageShort, this.x, this.y);
1218+
this.context.fillText(this.commitDotText, this.x, this.y);
12181219

12191220
this.context.textBaseline = previousTextBaseline;
12201221
this.context.textAlign = previousTextAlign;

0 commit comments

Comments
 (0)