Fossil SCM

When displaying a timeline on a narrow screen, move the date to the third column to make the first column narrower.

drh 2018-08-20 19:15 trunk
Commit 8fc7c1b1bb7ad597ae77f67dcdb55e3f3f6933609b2cdab7112d1f7f34d9ea7b
2 files changed +12 +1 -1
+12
--- src/graph.js
+++ src/graph.js
@@ -375,10 +375,22 @@
375375
if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail;
376376
}
377377
lx = topObj.getElementsByClassName('timelineCompactComment');
378378
for(i=0; i<lx.length; i++){
379379
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
+ }
380392
}
381393
}
382394
383395
/* Look for all timeline-data-NN objects. Load each one and draw
384396
** a graph for each one.
385397
--- 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 @@
356356
** (4) (off)
357357
*/
358358
if( dateFormat<2 ){
359359
if( fossil_strnicmp(zDate, zPrevDate, 10) ){
360360
sqlite3_snprintf(sizeof(zPrevDate), zPrevDate, "%.10s", zDate);
361
- @ <tr><td>
361
+ @ <tr class="timelineDateRow"><td>
362362
@ <div class="divider timelineDate">%s(zPrevDate)</div>
363363
@ </td><td></td><td></td></tr>
364364
}
365365
memcpy(zTime, &zDate[11], 5+dateFormat*3);
366366
zTime[5+dateFormat*3] = 0;
367367
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button