| 1 | <html lang="en"> |
| 2 | <head> |
| 3 | <meta charset="utf-8" /> |
| 4 | <script type="application/javascript" src="../../../src/htmx.js"></script> |
| 5 | <title>History - Index</title> |
| 6 | <script> |
| 7 | htmx.logAll(); |
| 8 | htmx.onLoad(function(src){ |
| 9 | var btn = src.querySelector("button"); |
| 10 | btn.addEventListener("htmx:beforeOnLoad", function(evt){ |
| 11 | evt.detail.keepIndicators = true; |
| 12 | }) |
| 13 | }) |
| 14 | </script> |
| 15 | </head> |
| 16 | <body style="padding:20px;font-family: sans-serif"> |
| 17 | <h1>Indicator Visibility Test</h1> |
| 18 | <p> |
| 19 | This test marks the response as <code>keepIndicators</code>, so the indicator span should remain visible after the |
| 20 | request finishes. |
| 21 | </p> |
| 22 | <button hx-get="1.html" hx-indicator="#indicator"> |
| 23 | Click Me |
| 24 | </button> |
| 25 | <span id="indicator" class="htmx-indicator"> |
| 26 | Should Remain Visible... |
| 27 | </span> |
| 28 | </body> |
| 29 | </html> |