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

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: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 03e0edde
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -446,9 +446,18 @@ $designskinform = pieform($designskinelements);

$javascript = <<<EOF
  function designskinform_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;