summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2023-07-11 13:13:08 +0200
committerJose M. Guisado <jguisado@soleta.eu>2023-07-11 17:52:17 +0200
commit0b210404d8befe2deb21e5156d823edcc0724c96 (patch)
tree353a3ba26c40bcd828f8645ac062eff6eff01641
parentdb68dcea4660c0cbac22432b1564a494224969bf (diff)
ogcp.js: fix images selector in "images" section
Any operation inside "Images" view fails with error message 'missing "image-server" key'. Operations under images view section are loading image info and "delete image". Previously, a hidden checkbox entry was added to support multiple ogServer images entries. This hidden checkbox value holds the corresponding ogServer address of some image list. This hidden 'image-server' checkbox is checked or unchecked whenever some visible image from this server is checked in the list by the user. Commit 70eb7389bb5d introduces checkImageServer javascript function that mainly attaches an onchange event to each image checkbox so that checking or unchecking it updates the hidden 'image-server' checkboxes holding the ogserver address associated with each ogserver entry list. When loading "Images" view each configured ogServer entry is collapsed (thus each image checkbox is hidden). The current selector is ignoring hidden checkboxes and thus checkImageServer is unable to attach the necessary onchange event to each image checkbox. The hidden 'image-server' checkbox is always hidden and does not need attaching any onchange event. Fix selector by not ignoring hidden elements and omitting any checkbox with name 'image-server'. Fixes: 70eb7389bb5d ("Add ogServer parameter to imagesForm")
-rw-r--r--ogcp/static/js/ogcp.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js
index 61d828d..6473373 100644
--- a/ogcp/static/js/ogcp.js
+++ b/ogcp/static/js/ogcp.js
@@ -293,7 +293,7 @@ function RemovePartition(evt) {
}
function checkImageServer() {
- const images = $('input:checkbox[form|="imagesForm"]:not(:hidden)')
+ const images = $('input:checkbox[form|="imagesForm"][name!="image-server"]')
images.on('change', function() {
const selectedServer = $('#' + $.escapeSelector(this.dataset.server));