| 1 | <html lang="en"> |
| 2 | <head> |
| 3 | <meta charset="utf-8" /> |
| 4 | <title>Test Scroll Behavior</title> |
| 5 | <script src="../../src/htmx.js"></script> |
| 6 | </head> |
| 7 | <body style="padding:20px;font-family: sans-serif"> |
| 8 | <script src="../../node_modules/sinon/pkg/sinon.js"></script> |
| 9 | <script src="../../src/htmx.js"></script> |
| 10 | <script src="../util/util.js"></script> |
| 11 | <script> |
| 12 | server = makeServer(); |
| 13 | server.autoRespond = true; |
| 14 | server.respondWith("GET", "/more_divs", "<div>More Content</div>"); |
| 15 | </script> |
| 16 | <h1>Should Not Add Any Content Due To False Condition</h1> |
| 17 | <div hx-trigger="every 3s [false]" hx-get="/more_divs" hx-swap="beforeend" style="height: 100px; overflow: scroll"> |
| 18 | No Polling.... |
| 19 | </div> |
| 20 | <hr/> |
| 21 | <h1>Should Add Content Due To True Condition</h1> |
| 22 | <div hx-trigger="every 3s [true]" hx-get="/more_divs" hx-swap="beforeend" style="height: 100px; overflow: scroll"> |
| 23 | No Polling.... |
| 24 | </div> |
| 25 | <hr/> |
| 26 | |
| 27 | </body> |
| 28 | </html> |