File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1515}
1616---
1717
18+ <script type =" module " >
19+ const LS_KEY = ' html-lit-react-snippets-index' ;
20+ document .addEventListener (' expand' , async function (event ) {
21+ const PfTabs = await customElements .whenDefined (' pf-tabs' );
22+ if (PfTabs .isExpandEvent (event )) {
23+ const tabs = event .target .closest (' pf-tabs' );
24+ await tabs .updateComplete ;
25+ debugger ;
26+ localStorage .setItem (LS_KEY , tabs .activeIndex );
27+ update ();
28+ }
29+ });
30+ async function update () {
31+ for (const tabs of document .querySelectorAll (' pf-tabs.html-lit-react-snippets' )) {
32+ await tabs .updateComplete ;
33+ tabs .activeIndex = parseInt (localStorage .getItem (LS_KEY ) ?? ' 0' );
34+ }
35+ }
36+ update ();
37+ < / script>
38+
1839< header class = " band" >
1940 < h1> {{element .title }}< / h1>
2041
You can’t perform that action at this time.
0 commit comments