From 647ca335ea02e3f29b03eca3a0c45de394c8e1b5 Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sun, 23 Nov 2025 22:54:24 +0100 Subject: [PATCH] Improved locations screenreader navigation, fixed unable to delete location after editing --- src/Views/Home/Locations.cshtml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Views/Home/Locations.cshtml b/src/Views/Home/Locations.cshtml index d95bf4a..44f00f0 100644 --- a/src/Views/Home/Locations.cshtml +++ b/src/Views/Home/Locations.cshtml @@ -40,7 +40,7 @@ foreach (LocationTableViewModel locationTableViewModel in Model.LocationTableViewModels) { - @locationTableViewModel.LocationID + @locationTableViewModel.LocationID @locationTableViewModel.LocationName @locationTableViewModel.RoomNumber @locationTableViewModel.Seat @@ -234,6 +234,7 @@ const result = await response.json(); if (result) { const btn = document.querySelector(`button[data-location-id="${data.Location}"]`); + const btn_del = document.querySelector(`button.btn-danger[data-location-id="${data.Location}"]`); const row = btn.closest('tr'); let slugifiedLocationID = `${data.Description.Location}-${data.Description.RoomNumber}-${data.Description.Seat}` .toLowerCase() @@ -244,6 +245,10 @@ btn.setAttribute("data-location-name", data.Description.Location); btn.setAttribute("data-room-number", data.Description.RoomNumber); btn.setAttribute("data-seat", data.Description.Seat); + btn_del.setAttribute("data-location-id", slugifiedLocationID); + btn_del.setAttribute("data-location-name", data.Description.Location); + btn_del.setAttribute("data-room-number", data.Description.RoomNumber); + btn_del.setAttribute("data-seat", data.Description.Seat); row.children[0].textContent = slugifiedLocationID; row.children[1].textContent = data.Description.Location; row.children[2].textContent = data.Description.RoomNumber; @@ -339,7 +344,7 @@ const tbody = document.querySelector('table tbody'); const newRow = document.createElement('tr'); newRow.innerHTML = ` - ${slugifiedLocationID} + ${slugifiedLocationID} ${newLoc.Location} ${newLoc.RoomNumber} ${newLoc.Seat}