diff options
author | pdp8 <pdp8@pdp8.info> | 2023-06-26 11:20:38 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-06-26 11:20:38 +0200 |
commit | 8453f524515941f3c0a65b5ca3b9354be76b4c33 (patch) | |
tree | c33131d99193f5a5875ae1869e8cafa11e2a803e /views/index.erb | |
parent | cec92f7d472c53bdd5d2aa480179ee30c27e8b38 (diff) |
hidden reply form
Diffstat (limited to 'views/index.erb')
-rw-r--r-- | views/index.erb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/views/index.erb b/views/index.erb index 269c495..0021ec9 100644 --- a/views/index.erb +++ b/views/index.erb @@ -18,4 +18,22 @@ </form> <% end %> </body> + <script> + const reply_buttons = document.querySelectorAll(".reply"); + for (const button of reply_buttons) { + button.addEventListener('click', function() { + const form = document.getElementById('form' + button.getAttribute('data-index')); + button.style.display = 'none'; + form.style.display = 'block'; + }); + }; + const cancel_buttons = document.querySelectorAll(".cancel"); + for (const button of cancel_buttons) { + button.addEventListener('click', function() { + const form = document.getElementById('form' + button.getAttribute('data-index')); + button.style.display = 'block'; + form.style.display = 'none'; + }); + }; + </script> </html> |