From 453831c6112e32e7f1efb281e8e9236be37e82fb Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Mon, 11 Mar 2019 15:08:30 -0600 Subject: [PATCH] Add buttons to remove people --- public/parts/template_person.php | 1 + public/static/signup.js | 5 +++++ public/static/style.css | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/public/parts/template_person.php b/public/parts/template_person.php index 9d34411..97e1296 100644 --- a/public/parts/template_person.php +++ b/public/parts/template_person.php @@ -50,6 +50,7 @@ if (isset($personid) && $database->has('people', ['personid' => $personid])) { ?>
+
Remove
diff --git a/public/static/signup.js b/public/static/signup.js index 4c57e81..e8a3cb5 100644 --- a/public/static/signup.js +++ b/public/static/signup.js @@ -61,6 +61,11 @@ $("#adult_list").on("change", "input[data-name=days]", function () { updateTotal(); }); +$(".list-group").on("click", ".rmpersonbtn", function () { + $(this).parent().remove(); + updateTotal(); +}); + function updateTotal() { totalcharge = $(".person-list-item[data-persontype=camper] input[data-name=firstname]").filter(function () { return $(this).val() != ''; diff --git a/public/static/style.css b/public/static/style.css index 48f7e93..c569320 100644 --- a/public/static/style.css +++ b/public/static/style.css @@ -14,4 +14,12 @@ body, html { .person-list-item { border: 1.5px solid var(--teal); +} + +.rmpersonbtn { + position: absolute; + right: 1em; + top: 1em; + cursor: pointer; + z-index: 99999999; } \ No newline at end of file