Skip to content

Commit 962b8ee

Browse files
committed
[repo-viewer] Resizing works on the tree view as well
1 parent 621e194 commit 962b8ee

File tree

4 files changed

+44
-17
lines changed

4 files changed

+44
-17
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ The client side API implements:
2828
* browsing the object graph
2929
* creating HTML object diffs
3030

31-
3231
Usage
3332
-----
3433

demos/repo-viewer/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<html lang="en">
44
<head>
55
<meta charset="utf-8" />
6+
<title>git.js Repo Viewer</title>
67
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
78
<script src="/git.min.js"></script>
89
<script src="repo-viewer.js"></script>
@@ -75,6 +76,8 @@ <h3>git.js</h3>
7576
</div>
7677
<div id="diff-view">
7778
<div id="diff-view-window">
79+
<div id="diff">
80+
</div>
7881
</div>
7982
</div>
8083
</div>

demos/repo-viewer/repo-viewer.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ RepoViewer = {
193193
str += "<hr>"
194194
str += "<pre class='message'>" + commit.message + "</pre>"
195195

196-
$("#diff-view-window").html(str)
196+
$("#diff").html(str)
197197
},
198198

199199
treeAsHash: function(tree) {
@@ -223,7 +223,7 @@ RepoViewer = {
223223
})
224224
str.push("</table>")
225225
str.push("<hr>")
226-
$("#diff-view-window").append(str.join("\n"))
226+
$("#diff").append(str.join("\n"))
227227

228228
var str = []
229229
_(changes).each(function(change) {
@@ -233,7 +233,7 @@ RepoViewer = {
233233
str.push(diff.toHtml())
234234
str.push("</div>")
235235
})
236-
$("#diff-view-window").append(str.join("\n"))
236+
$("#diff").append(str.join("\n"))
237237
})
238238
treeDiffGenerator.generate()
239239
})
@@ -242,7 +242,7 @@ RepoViewer = {
242242
displayCommitDiff: function(commit) {
243243
RepoViewer.displayCommitDiffInfo(commit)
244244
if (commit.parents.length > 1) {
245-
$("#diff-view-window").append("Multiple parents.")
245+
$("#diff").append("Multiple parents.")
246246
}
247247
else {
248248
RepoViewer.displayCommitDiffDiff(commit)

demos/repo-viewer/style.css

+37-12
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,46 @@ table#main td {
5555
vertical-align: top;
5656
}
5757

58+
#tree-view {
59+
width: 100%;
60+
height: 100%;
61+
}
62+
63+
#top-directory {
64+
overflow: scroll;
65+
width: 25%;
66+
height: 100%;
67+
float:left;
68+
}
69+
70+
#top-directory ul {
71+
margin: 0;
72+
padding: 0;
73+
padding-left: 10px;
74+
list-style-type: none;
75+
}
76+
77+
#top-directory li {
78+
margin: 0;
79+
padding: 0;
80+
padding-left: 10px;
81+
list-style-type: none;
82+
}
83+
84+
#file-main {
85+
width: 75%;
86+
height: 100%;
87+
float:left;
88+
}
5889

5990
#file-view {
6091
overflow: scroll;
61-
width: 800px;
62-
height: 400px;
92+
width: 100%;
93+
height: 100%;
6394
font-size: 0.8em;
6495
}
6596

6697
#file-view .syntaxhighlighter {
67-
overflow: scroll;
68-
width: 800px !important;
69-
height: 400px;
7098
}
7199

72100
#view-select a {
@@ -86,12 +114,6 @@ table#main td {
86114
margin-top: 10px;
87115
}
88116

89-
#top-directory {
90-
overflow: scroll;
91-
width: 250px;
92-
height: 400px;
93-
}
94-
95117
#jsgit-errors {
96118
color: red;
97119
}
@@ -118,7 +140,6 @@ table#main td {
118140

119141
#diff-view {
120142
height: 100%;
121-
padding: 10px;
122143
}
123144

124145
#diff-view-window {
@@ -128,6 +149,10 @@ table#main td {
128149
font-size: 0.8em;
129150
}
130151

152+
#diff-view-window #diff {
153+
padding: 10px;
154+
}
155+
131156
#diff-view-window .gravatar {
132157
padding: 3px;
133158
padding-bottom: 0px;

0 commit comments

Comments
 (0)