[gitg/wip/patch-stage: 2/11] Move stage button to template
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/patch-stage: 2/11] Move stage button to template
- Date: Tue, 31 Dec 2013 14:19:31 +0000 (UTC)
commit 670909ad065170512d73a27b598885c902fe1e9e
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Dec 28 15:48:27 2013 +0100
Move stage button to template
libgitg/resources/diff-view-html-builder.js | 8 ++++----
libgitg/resources/diff-view.html | 1 +
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libgitg/resources/diff-view-html-builder.js b/libgitg/resources/diff-view-html-builder.js
index 3698326..0ced0eb 100644
--- a/libgitg/resources/diff-view-html-builder.js
+++ b/libgitg/resources/diff-view-html-builder.js
@@ -21,7 +21,7 @@ function diff_file(file, lnstate, data)
var hunk_header = '<span class="hunk_stats">@@ -' + h.range.old.start + ',' +
h.range.old.lines + ' +' + h.range.new.start + ',' + h.range.new.lines + ' @@</span>';
- hunk_header = lnstate.stagebutton + hunk_header;
+ hunk_header = hunk_header;
file_body += '<tr class="hunk_header">\
<td class="gutter old">' + lnstate.gutterdots + '</td> \
@@ -114,13 +114,12 @@ function diff_file(file, lnstate, data)
var file_stats = '<span class="file_stats"><span class="number">' + (added + removed) +
'</span><span class="bar"><span class="added" style="width: ' + addedp + '%;"></span><span class="removed"
style="width: ' + removedp + '%;"></span></span></span>';
- file_stats = lnstate.stagebutton + file_stats;
-
var template = data.file_template;
var repls = {
'FILE_PATH': file_path,
'FILE_BODY': file_body,
'FILE_STATS': file_stats,
+ 'FILE_STAGE': lnstate.stagebutton,
};
for (var r in repls)
@@ -144,7 +143,8 @@ function diff_files(files, lines, maxlines, data)
var repl = [
'FILE_PATH',
'FILE_BODY',
- 'FILE_STATS'
+ 'FILE_STATS',
+ 'FILE_STAGE'
];
var replacements = {};
diff --git a/libgitg/resources/diff-view.html b/libgitg/resources/diff-view.html
index 7087cc8..0619ec4 100644
--- a/libgitg/resources/diff-view.html
+++ b/libgitg/resources/diff-view.html
@@ -31,6 +31,7 @@
<tr class="file_header">
<td colspan="3">
<span class="expander">-</span>
+ <!-- ${FILE_STAGE} -->
<!-- ${FILE_STATS} -->
<span class="file_path"><!-- ${FILE_PATH} --></span>
</td>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]