Skip to content

Commit 39505c6

Browse files
committed
restore parents in commit header in history view
1 parent 78cd92e commit 39505c6

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

Resources/html/views/history/history.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ a.servicebutton:hover {
6262
font-family: Menlo, Monaco, monospace;
6363
}
6464

65+
#parents span:not(:first-child)::before {
66+
content: ', ';
67+
}
68+
6569
.gravatar {
6670
float: left;
6771
margin-right: 5px;

Resources/html/views/history/history.js

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,20 +228,19 @@ var loadCommit = function(commitObject, currentRef) {
228228
while (filelist.hasChildNodes())
229229
filelist.removeChild(filelist.lastChild);
230230
showRefs();
231-
removeParentsFromCommitHeader();
232231

233232
// Scroll to top
234233
scroll(0, 0);
235234

236-
if (!commit.parents)
237-
return;
238-
239-
for (var i = 0; i < commit.parents.length; i++) {
240-
var newRow = $("commit_header").insertRow(-1);
241-
newRow.innerHTML = "<td class='property_name'>Parent:</td><td>" +
242-
"<a class='SHA commit-link' href=''>" +
243-
commit.parents[i].SHA() + "</a></td>";
244-
bindCommitSelectionLinks(newRow);
235+
var parentsNode = $("parents");
236+
parentsNode.innerHTML = '';
237+
if (commit.parents) {
238+
for (var i = 0; i < commit.parents.length; i++) {
239+
var container = document.createElement("span");
240+
container.innerHTML = '<a class="SHA commit-link" href="">' + commit.parents[i].SHA() + "</a>";
241+
parentsNode.appendChild(container);
242+
}
243+
bindCommitSelectionLinks(parentsNode);
245244
}
246245

247246
commit.notificationID = setTimeout(function() {
@@ -252,16 +251,6 @@ var loadCommit = function(commitObject, currentRef) {
252251

253252
}
254253

255-
var removeParentsFromCommitHeader = function() {
256-
for (var i = 0; i < $("commit_header").rows.length; ++i) {
257-
var row = $("commit_header").rows[i];
258-
if (row.innerHTML.match(/Parent:/)) {
259-
row.parentNode.removeChild(row);
260-
--i;
261-
}
262-
}
263-
};
264-
265254
var showMultipleSelectionMessage = function(messageParts) {
266255
jQuery("#commit").hide();
267256
jParagraphs = jQuery.map(messageParts, function(message) {

Resources/html/views/history/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<span id="refs"></span>
3737
</td>
3838
</tr>
39+
<tr>
40+
<th class="property_name">Parents</th>
41+
<td id="parents"></td>
42+
</tr>
3943
<tr>
4044
<th class="property_name">Author</th>
4145
<td>

0 commit comments

Comments
 (0)