mirror of https://git.48k.eu/ogcp
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. Commitmaster70eb7389bb
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:70eb7389bb
("Add ogServer parameter to imagesForm")
parent
db68dcea46
commit
0b210404d8
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue