From cc5c0105dbf11bfffd6f439181326a841bbeb27d Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Mon, 11 Dec 2023 11:40:12 +0100 Subject: ogcp.js: Fix bug when adding a new partition Fix a bug that made the 'add a new partition' button unusable if all partitions (rows) were deleted. The reason for this bug was that the AddPartition() function would add a new partition by cloning an already present html row element. This would fail if no more rows were present in the table. The solution implemented checks, previous to delete a partition, if it is the last partition. If it is, then, instead of removing the whole row, it just empties it. Html button element needs to contain 'type="button"' attribute for this to work. Otherwise, default action for the button is submit and it would redirect after clicking. --- ogcp/templates/actions/setup.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ogcp/templates') diff --git a/ogcp/templates/actions/setup.html b/ogcp/templates/actions/setup.html index a2b382a..68aefe9 100644 --- a/ogcp/templates/actions/setup.html +++ b/ogcp/templates/actions/setup.html @@ -62,7 +62,7 @@ {{ partition.size(class_="form-control") }} {{ partition.format_partition(class_="form-control") }} - -- cgit v1.2.3-18-g5258