| | @@ -302,25 +302,16 @@ |
| 302 | 302 | function changeDisplay(selector,value){ |
| 303 | 303 | var x = document.getElementsByClassName(selector); |
| 304 | 304 | var n = x.length; |
| 305 | 305 | for(var i=0; i<n; i++) {x[i].style.display = value;} |
| 306 | 306 | } |
| 307 | | -function declutter(){ |
| 308 | | - changeDisplay('clutter','none'); |
| 309 | | - changeDisplay('anticlutter','inline'); |
| 310 | | - checkHeight(); |
| 311 | | -} |
| 312 | | -function reclutter(){ |
| 313 | | - changeDisplay('clutter','inline'); |
| 314 | | - changeDisplay('anticlutter','none'); |
| 315 | | - checkHeight(); |
| 316 | | -} |
| 317 | 307 | function changeDisplayById(id,value){ |
| 318 | 308 | var x = document.getElementById(id); |
| 319 | 309 | if(x) x.style.display=value; |
| 320 | 310 | } |
| 321 | | -function toggleDetail(id){ |
| 311 | +function toggleDetail(){ |
| 312 | + var id = parseInt(this.getAttribute('data-id')) |
| 322 | 313 | var x = gebi("detail-"+id); |
| 323 | 314 | if( x.style.display=="inline" ){ |
| 324 | 315 | x.style.display="none"; |
| 325 | 316 | changeDisplayById("ellipsis-"+id,"inline"); |
| 326 | 317 | changeDisplayById("links-"+id,"none"); |
| | @@ -350,5 +341,19 @@ |
| 350 | 341 | setTimeout(checkHeight, 1000); |
| 351 | 342 | } |
| 352 | 343 | initGraph(); |
| 353 | 344 | checkHeight(); |
| 354 | 345 | scrollToSelected(); |
| 346 | + |
| 347 | +/* Set the onclick= attributes for elements of the "Compact" display |
| 348 | +** mode so that clicking turns the details on and off. */ |
| 349 | +(function(){ |
| 350 | + var lx = document.getElementsByClassName('timelineEllipsis'); |
| 351 | + var i; |
| 352 | + for(i=0; i<lx.length; i++){ |
| 353 | + if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 354 | + } |
| 355 | + var lx = document.getElementsByClassName('timelineCompactComment'); |
| 356 | + for(i=0; i<lx.length; i++){ |
| 357 | + if( lx[i].hasAttribute('data-id') ) lx[i].onclick = toggleDetail; |
| 358 | + } |
| 359 | +}()) |
| 355 | 360 | |