File tree 2 files changed +13
-16
lines changed
2 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 266
266
font-weight : bold;
267
267
}
268
268
269
- details [open ] summary .sum-less {
269
+ . expand [open ] .sum-less {
270
270
display : none;
271
271
}
272
272
273
- details [open ] summary .sum-more {
273
+ . expand [open ] .sum-more {
274
274
display : block;
275
275
}
276
276
277
- details summary .sum-more {
277
+ . expand .sum-more {
278
278
display : none;
279
279
}
280
280
281
- details summary {
282
- list-style-type : none;
281
+ .expand {
283
282
position : relative;
284
- pointer-events : none;
285
283
}
286
284
287
- details summary : :before {
285
+ . expand . button : before {
288
286
content : "[+] " ;
289
287
font-family : var (--mono );
290
288
color : var (--link-color );
298
296
cursor : pointer;
299
297
}
300
298
301
- details [open ] summary : :before {
299
+ . expand [open ] . button : before {
302
300
content : "[-] " ;
303
301
}
304
302
Original file line number Diff line number Diff line change @@ -2476,7 +2476,7 @@ var zigAnalysis;
2476
2476
short = markdown ( short ) ;
2477
2477
var long = markdown ( docs ) ;
2478
2478
tdDesc . innerHTML =
2479
- "<details ontoggle =\"scrollOnCollapse (event); \"><summary ><div class=\"sum-less\">" + short + "</div>" + "<div class=\"sum-more\">" + long + "</div></summary ></details>" ;
2479
+ "<div class =\"expand\" ><span class=\"button\" onclick=\"toggleExpand (event)\"></span ><div class=\"sum-less\">" + short + "</div>" + "<div class=\"sum-more\">" + long + "</div></details>" ;
2480
2480
}
2481
2481
else {
2482
2482
tdDesc . innerHTML = markdown ( short ) ;
@@ -3718,12 +3718,11 @@ var zigAnalysis;
3718
3718
3719
3719
} ) ( ) ;
3720
3720
3721
- function scrollOnCollapse ( event ) {
3722
- const details = event . target ;
3723
- if ( ! details . open && details . getBoundingClientRect ( ) . top < 0 ) {
3724
- console . log ( "scrolling!" )
3725
- details . parentElement . parentElement . scrollIntoView ( true ) ;
3726
- } else {
3727
- console . log ( "not scrolling!" , details . open , details . top ) ;
3721
+ function toggleExpand ( event ) {
3722
+ const parent = event . target . parentElement ;
3723
+ parent . toggleAttribute ( "open" ) ;
3724
+
3725
+ if ( ! parent . open && parent . getBoundingClientRect ( ) . top < 0 ) {
3726
+ parent . parentElement . parentElement . scrollIntoView ( true ) ;
3728
3727
}
3729
3728
}
You can’t perform that action at this time.
0 commit comments