Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-3131

The default afterMove event listener code for the Image Reorderer doesn't get invoked, causing no results to be sent back to the server.

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 1.1.2
    • 0.6beta1, 0.6, 0.7, 0.8, 0.8.1, 1.0, 1.1, 1.1.1
    • Image Reorderer
    • None

    Description

      Currently, the Image Reorderer has a default afterMove event listener that takes care of updating the image order correctly for a form-based style of communicating with the server. It is intended to automatically POST the order back to the server after each move.

      However, there is a bug in the code that causes it to never be invoked. The code tries to assign the event listener to the options.afterMoveCallback member, which is no longer supported by the Reorderer (and hasn't been since about Infusion 0.6 or so).

      The fix is simple and will be included in Infusion 1.2. In the meantime, there are straightforward workarounds. Try this:

      var url; // Put the URL you want to POST the order back to here.

      fluid.reorderer("#gallery", {
      listeners: {
      afterMove: function (imageMoved, position, allImages) {
      images.each(function (idx, image)

      { jQuery(image).children("input").val(idx); }

      );

      var imageOrder = jQuery("#reorder-form").serialize();
      jQuery.ajax({
      type: "POST",
      url: url,
      data: imageOrder,
      complete: function (data, ajaxStatus)

      { // Handle success or failure by being nice to the user. }

      });
      }
      }
      });

      Attachments

        Activity

          People

            jobara Justin Obara
            colin Colin Clark
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: