git ssb

30+

cel / git-ssb-web



Commit 968d06e32da02d4a712327a84f89a90e040e3bc0

Improve handling layout edge cases

Charles Lehner committed on 3/27/2016, 5:52:43 PM
Parent: 938ec32c4cb0a8be01d3db6338e3fd585eb1b3ff

Files changed

index.jschanged
static/styles.csschanged
index.jsView
@@ -157,9 +157,9 @@
157157
158158 function renderPostForm(repo, placeholder, rows) {
159159 return '<input type="radio" class="tab-radio" id="tab1" name="tab" checked="checked"/>' +
160160 '<input type="radio" class="tab-radio" id="tab2" name="tab"/>' +
161- '<div class="tab-links">' +
161+ '<div id="tab-links" class="tab-links" style="display:none">' +
162162 '<label for="tab1" id="write-tab-link" class="tab1-link">Write</label>' +
163163 '<label for="tab2" id="preview-tab-link" class="tab2-link">Preview</label>' +
164164 '</div>' +
165165 '<input type="hidden" id="repo-id" value="' + repo.id + '"/>' +
@@ -268,8 +268,9 @@
268268 }
269269
270270 var issueCommentScript = '(' + function () {
271271 var $ = document.getElementById.bind(document)
272+ $('tab-links').style.display = 'block'
272273 $('preview-tab-link').onclick = function (e) {
273274 with (new XMLHttpRequest()) {
274275 open('POST', '', true)
275276 onload = function() {
@@ -787,9 +788,9 @@
787788
788789 function renderRepoPage(repo, branch, body) {
789790 var gitUrl = 'ssb://' + repo.id
790791 var gitLink = '<input class="clone-url" readonly="readonly" ' +
791- 'value="' + gitUrl + '" size="' + (2 + gitUrl.length) + '" ' +
792+ 'value="' + gitUrl + '" size="61" ' +
792793 'onclick="this.select()"/>'
793794 var digsPath = [repo.id, 'digs']
794795
795796 var done = multicb({ pluck: 1, spread: true })
@@ -1245,9 +1246,9 @@
12451246 numIssues++
12461247 return '<section class="collapse">' +
12471248 '<a href="' + encodeLink(issue.id) + '">' +
12481249 escapeHTML(issue.title) +
1249- '<span class="issue-info">' +
1250+ '<span class="right-bar">' +
12501251 new Date(issue.created_at).toLocaleString() +
12511252 '</span>' +
12521253 '</a>' +
12531254 '</section>'
static/styles.cssView
@@ -123,8 +123,9 @@
123123 .name-checkbox,
124124 .tab-radio {
125125 position: absolute;
126126 opacity: 0;
127+ font-size: 0;
127128 }
128129
129130 .name-checkbox:checked ~ h2 :last-child,
130131 .name-checkbox:checked ~ h3,
@@ -149,8 +150,9 @@
149150 }
150151
151152 nav {
152153 margin: .5em 0 1ex 0;
154+ clear: left;
153155 }
154156
155157 nav a {
156158 border-radius: .5ex;
@@ -209,14 +211,8 @@
209211 font-size: inherit;
210212 line-height: inherit;
211213 }
212214
213-/* issues */
214-
215-.issue-info {
216- float: right;
217-}
218-
219215 /* issue */
220216
221217 .issue-status {
222218 padding: .4ex .75ex;
@@ -255,12 +251,17 @@
255251 text-decoration: underline;
256252 }
257253
258254 #tab1:not(:checked) ~ .tab1,
259-#tab2:not(:checked) ~ .tab2 {
255+.tab2 {
260256 display: none;
261257 }
262258
259+.tab1,
260+#tab2:checked ~ .tab2 {
261+ display: block;
262+}
263+
263264 .preview-text {
264265 border: 1px solid #c0bdba;
265266 min-height: 6em;
266267 margin: .25ex 0;

Built with git-ssb-web