From 5a6a013afdcbc84c963826683825bc846e3aae17 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sat, 4 Jan 2025 10:32:00 +1300 Subject: [PATCH] persist post reply fieldset state --- app/static/js/coolfieldset.js | 2 ++ app/templates/post/add_reply.html | 6 +++--- app/templates/post/post_edit.html | 4 ++-- app/templates/post/post_reply_edit.html | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/static/js/coolfieldset.js b/app/static/js/coolfieldset.js index c3d021fc..7f27dc6d 100644 --- a/app/static/js/coolfieldset.js +++ b/app/static/js/coolfieldset.js @@ -18,6 +18,7 @@ if (!options.animation) { fieldset.dispatchEvent(new Event('update')); } + setCookie(`fieldset_${fieldset.id}_state`, 'collapsed', 365); } function showFieldsetContent(fieldset, options) { @@ -39,6 +40,7 @@ if (!options.animation) { fieldset.dispatchEvent(new Event('update')); } + setCookie(`fieldset_${fieldset.id}_state`, 'expanded', 365); } function doToggle(fieldset, setting) { diff --git a/app/templates/post/add_reply.html b/app/templates/post/add_reply.html index d1f412c6..b81454b5 100644 --- a/app/templates/post/add_reply.html +++ b/app/templates/post/add_reply.html @@ -6,14 +6,14 @@ {% from 'bootstrap/form.html' import render_form %} {% block app_content %} - +