Subscription cards are now expandable

This commit is contained in:
ellite
2023-11-15 20:04:08 +01:00
parent 190c052963
commit 0cd6f64978
12 changed files with 91 additions and 65 deletions
+7 -1
View File
@@ -1,5 +1,10 @@
let isSortOptionsOpen = false;
function toggleOpenSubscription(subId) {
const subscriptionElement = document.querySelector('.subscription[data-id="' + subId + '"]');
subscriptionElement.classList.toggle('is-open');
}
function toggleSortOptions() {
const sortOptions = document.querySelector("#sort-options");
sortOptions.classList.toggle("is-open");
@@ -74,7 +79,8 @@ function fillEditFormFields(subscription) {
modal.classList.add("is-open");
}
function openEditSubscription(id) {
function openEditSubscription(event, id) {
event.stopPropagation();
const url = `endpoints/subscription/get.php?id=${id}`;
fetch(url)
.then((response) => {
-6
View File
@@ -556,12 +556,6 @@ function switchTheme() {
document.cookie = `theme=${themeChoice}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
}
function setHideNameOnMobileCookie() {
const hideNameCheckbox = document.querySelector("#hidename");
const value = hideNameCheckbox.checked;
document.cookie = `hideNameOnMobile=${value}; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/`;
}
function setShowMonthlyPriceCookie() {
const showMonthlyPriceCheckbox = document.querySelector("#monthlyprice");
const value = showMonthlyPriceCheckbox.checked;