diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-05-10 17:03:11 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-05-12 14:59:53 +0200 |
commit | 6034ba2537368f7da0569e7614bd2c7f110457b1 (patch) | |
tree | 6c9f353596a6c78adcc0f37d897c3011f950841b /ogcp/static/js/ogcp.js | |
parent | a04ef4e421ec29a3fb2f8181b5c7af381767001c (diff) |
Make partition id non editable in partition form
Show the partition id as a non editable label in each partition
of the Partition and Format form.
Assign sequential partition id from top to down and recalculate
every partition id when a partition is removed.
Diffstat (limited to 'ogcp/static/js/ogcp.js')
-rw-r--r-- | ogcp/static/js/ogcp.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 4779bf4..1b6d888 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -313,6 +313,8 @@ function AddPartition(evt) { const id = $(this).attr('id').replace(/(.*)-(\d{1,4})-(.*)/, `$1-${elem_num}-$3`); $(this).attr('name', id).attr('id', id).val('').removeAttr("checked"); }); + let part_field = row.find('td').filter(':first')[0]; + part_field.innerText = elem_num + 1; row.show(); oldrow.after(row); } @@ -329,6 +331,9 @@ function RemovePartition(evt) { const id = $(this).attr('id').replace(/(.*)-(\d{1,4})-(.*)/, `$1-${index}-$3`); $(this).attr('name', id).attr('id', id); } + + let part_field = $(this).find('td').filter(':first')[0]; + part_field.innerText = index + 1; $(this).find('input').filter(':first').each(update_references); $(this).find('.form-control').each(update_references); }); |