…this matches browsers' native behaviour.
Showing the changes to assets/javascripts/lib (1 of 2 files). Show all
Unified · Split
| @@ -353,6 +353,16 @@ $.lockScroll = function (el, fn) { · 352 unmodified lines | ||
| 353 | 353 | } |
| 354 | 354 | }; |
| 355 | 355 | |
| 356 | +// If `el` is inside any `<details>` elements, expand them. | |
| 357 | +$.openDetailsAncestors = function (el) { | |
| 358 | + while (el) { | |
| 359 | + if (el.tagName === "DETAILS") { | |
| 360 | + el.open = true; | |
| 361 | + } | |
| 362 | + el = el.parentElement; | |
| 363 | + } | |
| 364 | +} | |
| 365 | + | |
| 356 | 366 | let smoothScroll = |
| 357 | 367 | (smoothStart = |
| 358 | 368 | smoothEnd = |