Commit 63cfb900 authored by Robert Lyon's avatar Robert Lyon

Bug 1848096: Allow multi filebrowsers on one form

As we have 2 filebrowsers on the form using it's normal reply back
logic was not going to work.

Had to change it so that folder update updates the correct element

behatnotneeded

Change-Id: I24a1cdba65608a0328bd6db98840c62367975f1b
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 03e0edde
......@@ -446,8 +446,17 @@ $designskinform = pieform($designskinelements);
$javascript = <<<EOF
function designskinform_callback(form, data) {
if (typeof designskinform_body_background_image != "undefined") {
designskinform_body_background_image.callback(form, data);
// with multiple filebrowsers on form we need to update the right one
// when changing to subdirectories
if (data.formelement && typeof window[data.formelement] != "undefined") {
window[data.formelement].callback(form, data);
}
else {
// We are submitting the form so need to allow one of the
// filebrowsers to callback to complete the save
if (typeof designskinform_body_background_image != "undefined") {
designskinform_body_background_image.callback(form, data);
}
}
};
EOF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment