summaryrefslogtreecommitdiff
path: root/views/index.erb
diff options
context:
space:
mode:
Diffstat (limited to 'views/index.erb')
-rw-r--r--views/index.erb18
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>