|
1053 | 1053 | * @param {number[]} [options.lineDash = this.template.commit.dot.lineDash]
|
1054 | 1054 | *
|
1055 | 1055 | * @param {string} [options.message = "He doesn't like George Michael! Boooo!"] - Commit message
|
| 1056 | + * @param {string} [options.commitDotText] - short commit message (A few chars) to appear on the commit dot |
1056 | 1057 | * @param {string} [options.messageColor = options.color] - Specific message color
|
1057 | 1058 | * @param {string} [options.messageFont = this.template.commit.message.font] - Font of the message
|
1058 | 1059 | * @param {boolean} [options.messageDisplay = this.template.commit.message.display] - Commit message display policy
|
|
1086 | 1087 | this.detail = options.detail || null;
|
1087 | 1088 | this.sha1 = options.sha1 || (Math.random(100)).toString(16).substring(3, 10);
|
1088 | 1089 | this.message = options.message || "He doesn't like George Michael! Boooo!";
|
| 1090 | + this.commitDotText = options.commitDotText; |
1089 | 1091 | this.arrowDisplay = options.arrowDisplay;
|
1090 | 1092 | this.messageDisplay = _booleanOptionOr(options.messageDisplay, this.template.commit.message.display);
|
1091 | 1093 | this.messageAuthorDisplay = _booleanOptionOr(options.messageAuthorDisplay, this.template.commit.message.displayAuthor);
|
|
1205 | 1207 | }
|
1206 | 1208 | }
|
1207 | 1209 |
|
| 1210 | + // Commit Dot Text |
| 1211 | + if (this.commitDotText) { |
| 1212 | + var previousTextBaseline = this.context.textBaseline; |
| 1213 | + var previousTextAlign = this.context.textAlign; |
| 1214 | + |
| 1215 | + this.context.fillStyle = "#000"; |
| 1216 | + this.context.textAlign = "center"; |
| 1217 | + this.context.textBaseline = 'middle'; |
| 1218 | + this.context.fillText(this.commitDotText, this.x, this.y); |
| 1219 | + |
| 1220 | + this.context.textBaseline = previousTextBaseline; |
| 1221 | + this.context.textAlign = previousTextAlign; |
| 1222 | + } |
| 1223 | + |
1208 | 1224 | // Message
|
1209 | 1225 | if (this.messageDisplay) {
|
1210 | 1226 | var message = this.message;
|
|
0 commit comments