Skip to content

Commit d88ff36

Browse files
author
Rodrigo Fernandes
committed
Merge pull request #28 from Rantanen/master
Align the file summary
2 parents 90b8892 + 26d349b commit d88ff36

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

css/diff2html.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
}
3434

3535
.d2h-lines-added {
36+
text-align: right;
37+
}
38+
39+
.d2h-lines-added > * {
3640
background-color: #ceffce;
3741
border: 1px solid #b4e2b4;
3842
color: #399839;
@@ -42,6 +46,10 @@
4246
}
4347

4448
.d2h-lines-deleted {
49+
text-align: left;
50+
}
51+
52+
.d2h-lines-deleted > * {
4553
background-color: #f7c8c8;
4654
border: 1px solid #e9aeae;
4755
color: #c33;

src/file-list-printer.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@
2121
' <a id="' + hideId + '" class="d2h-hide" href="#' + hideId + '">+</a>\n' +
2222
' <a id="' + showId + 'd2h-show" class="d2h-show" href="#' + showId + '">-</a>\n' +
2323
' <div class="d2h-clear"></div>\n' +
24-
' <div class="d2h-file-list">\n' +
24+
' <table class="d2h-file-list">\n' +
2525

2626

2727
diffFiles.map(function (file) {
28-
return ' <div class="d2h-file-list-line">\n' +
29-
' <div class="d2h-file-stats">\n' +
30-
' <span class="d2h-lines-added">+' + file.addedLines + '</span>\n' +
31-
' <span class="d2h-lines-deleted">-' + file.deletedLines + '</span>\n' +
32-
' </div>\n' +
33-
' <div class="d2h-file-name"><a href="#' + printerUtils.getHtmlId(file) + '">&nbsp;' + printerUtils.getDiffName(file) + '</a></div>\n' +
34-
' </div>\n'
28+
return ' <tr class="d2h-file-list-line">\n' +
29+
' <td class="d2h-lines-added">\n' +
30+
' <span>+' + file.addedLines + '</span>\n' +
31+
' </td>\n' +
32+
' <td class="d2h-lines-deleted">\n' +
33+
' <span>-' + file.deletedLines + '</span>\n' +
34+
' </td>\n' +
35+
' <td class="d2h-file-name"><a href="#' + printerUtils.getHtmlId(file) + '">&nbsp;' + printerUtils.getDiffName(file) + '</a></td>\n' +
36+
' </tr>\n'
3537
}).join('\n') +
36-
'</div></div>\n';
38+
'</table></div>\n';
3739
};
3840

3941
module.exports['FileListPrinter'] = new FileListPrinter();

0 commit comments

Comments
 (0)