Fossil SCM
When displaying a timeline on a narrow screen, move the date to the third column to make the first column narrower.
Commit
8fc7c1b1bb7ad597ae77f67dcdb55e3f3f6933609b2cdab7112d1f7f34d9ea7b
Parent
02bd594146d1f1f…
2 files changed
+12
+1
-1
+12
| --- src/graph.js | ||
| +++ src/graph.js | ||
| @@ -375,10 +375,22 @@ | ||
| 375 | 375 | if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 376 | 376 | } |
| 377 | 377 | lx = topObj.getElementsByClassName('timelineCompactComment'); |
| 378 | 378 | for(i=0; i<lx.length; i++){ |
| 379 | 379 | if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 380 | + } | |
| 381 | + if( window.innerWidth<400 ){ | |
| 382 | + /* On narrow displays, shift the date from the first column to the | |
| 383 | + ** third column, to make the first column narrower */ | |
| 384 | + lx = topObj.getElementsByClassName('timelineDateRow'); | |
| 385 | + for(i=0; i<lx.length; i++){ | |
| 386 | + var rx = lx[i]; | |
| 387 | + if( rx.getAttribute('data-reordered') ) break; | |
| 388 | + rx.setAttribute('data-reordered',1); | |
| 389 | + rx.appendChild(rx.firstChild); | |
| 390 | + rx.insertBefore(rx.childNodes[1],rx.firstChild); | |
| 391 | + } | |
| 380 | 392 | } |
| 381 | 393 | } |
| 382 | 394 | |
| 383 | 395 | /* Look for all timeline-data-NN objects. Load each one and draw |
| 384 | 396 | ** a graph for each one. |
| 385 | 397 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -375,10 +375,22 @@ | |
| 375 | if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 376 | } |
| 377 | lx = topObj.getElementsByClassName('timelineCompactComment'); |
| 378 | for(i=0; i<lx.length; i++){ |
| 379 | if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | /* Look for all timeline-data-NN objects. Load each one and draw |
| 384 | ** a graph for each one. |
| 385 |
| --- src/graph.js | |
| +++ src/graph.js | |
| @@ -375,10 +375,22 @@ | |
| 375 | if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 376 | } |
| 377 | lx = topObj.getElementsByClassName('timelineCompactComment'); |
| 378 | for(i=0; i<lx.length; i++){ |
| 379 | if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 380 | } |
| 381 | if( window.innerWidth<400 ){ |
| 382 | /* On narrow displays, shift the date from the first column to the |
| 383 | ** third column, to make the first column narrower */ |
| 384 | lx = topObj.getElementsByClassName('timelineDateRow'); |
| 385 | for(i=0; i<lx.length; i++){ |
| 386 | var rx = lx[i]; |
| 387 | if( rx.getAttribute('data-reordered') ) break; |
| 388 | rx.setAttribute('data-reordered',1); |
| 389 | rx.appendChild(rx.firstChild); |
| 390 | rx.insertBefore(rx.childNodes[1],rx.firstChild); |
| 391 | } |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | /* Look for all timeline-data-NN objects. Load each one and draw |
| 396 | ** a graph for each one. |
| 397 |
+1
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -356,11 +356,11 @@ | ||
| 356 | 356 | ** (4) (off) |
| 357 | 357 | */ |
| 358 | 358 | if( dateFormat<2 ){ |
| 359 | 359 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 360 | 360 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 361 | - @ <tr><td> | |
| 361 | + @ <tr class="timelineDateRow"><td> | |
| 362 | 362 | @ <div class="divider timelineDate">%s(zPrevDate)</div> |
| 363 | 363 | @ </td><td></td><td></td></tr> |
| 364 | 364 | } |
| 365 | 365 | memcpy(zTime, &zDate[11], 5+dateFormat*3); |
| 366 | 366 | zTime[5+dateFormat*3] = 0; |
| 367 | 367 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -356,11 +356,11 @@ | |
| 356 | ** (4) (off) |
| 357 | */ |
| 358 | if( dateFormat<2 ){ |
| 359 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 360 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 361 | @ <tr><td> |
| 362 | @ <div class="divider timelineDate">%s(zPrevDate)</div> |
| 363 | @ </td><td></td><td></td></tr> |
| 364 | } |
| 365 | memcpy(zTime, &zDate[11], 5+dateFormat*3); |
| 366 | zTime[5+dateFormat*3] = 0; |
| 367 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -356,11 +356,11 @@ | |
| 356 | ** (4) (off) |
| 357 | */ |
| 358 | if( dateFormat<2 ){ |
| 359 | if( fossil_strnicmp(zDate, zPrevDate, 10) ){ |
| 360 | sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate); |
| 361 | @ <tr class="timelineDateRow"><td> |
| 362 | @ <div class="divider timelineDate">%s(zPrevDate)</div> |
| 363 | @ </td><td></td><td></td></tr> |
| 364 | } |
| 365 | memcpy(zTime, &zDate[11], 5+dateFormat*3); |
| 366 | zTime[5+dateFormat*3] = 0; |
| 367 |