summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/static/js/ogcp.js6
-rw-r--r--ogcp/templates/base.html2
2 files changed, 5 insertions, 3 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js
index ccd8a1e..4779bf4 100644
--- a/ogcp/static/js/ogcp.js
+++ b/ogcp/static/js/ogcp.js
@@ -325,10 +325,12 @@ function RemovePartition(evt) {
target.remove();
// Reassign rows ids
table.find('tr').each(function(index) {
- $(this).find('.form-control').each(function() {
+ function update_references() {
const id = $(this).attr('id').replace(/(.*)-(\d{1,4})-(.*)/, `$1-${index}-$3`);
$(this).attr('name', id).attr('id', id);
- });
+ }
+ $(this).find('input').filter(':first').each(update_references);
+ $(this).find('.form-control').each(update_references);
});
} else {
table.find('tr').each(function(index) {
diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html
index 9cb004b..9ade1d2 100644
--- a/ogcp/templates/base.html
+++ b/ogcp/templates/base.html
@@ -111,7 +111,7 @@
<!-- ChartJS -->
<script src="{{ url_for('static', filename='AdminLTE/plugins/chart.js/Chart.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=1"></script>
+ <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=2"></script>
<script>
// error messages