From 237730bf3b4cdc132569f1f0c4025ce67f994b61 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 16 Jan 2025 20:20:48 +0000 Subject: [PATCH] Bug 37883: Use localStorage instead of cookies to remember selection --- .../intranet-tmpl/prog/en/modules/catalogue/results.tt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 12eb813dc0b..96770b08dbd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -807,7 +807,7 @@ [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] $(document).ready( function() { - if ( Cookies.get("show_local_items") == 'local' ) { + if (localStorage.getItem("show_local_items") === 'local') { $('#toggleitems').click(); } }); @@ -823,9 +823,9 @@ $(this).toggleClass('show-local-items show-all-items'); if ($(this).hasClass('show-local-items')) { - Cookies.set("show_local_items", 'all', { path: '/', sameSite: 'Lax' }); + localStorage.setItem("show_local_items", 'all'); } else { - Cookies.set("show_local_items", 'local', { path: '/', sameSite: 'Lax' }); + localStorage.setItem("show_local_items", 'local'); } }); [% END %] -- 2.39.5