tagliatelle

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

list-open.js (446B)


      1   function openTagDetailsFromHash() {
      2     if (!window.location.hash) return;
      3     const target = document.getElementById(window.location.hash.slice(1));
      4     if (!target) return;
      5     const details = target.closest('details');
      6     if (details) {
      7       details.open = true;
      8       target.scrollIntoView();
      9     }
     10   }
     11   window.addEventListener('DOMContentLoaded', openTagDetailsFromHash);
     12   window.addEventListener('hashchange', openTagDetailsFromHash);