Infusion 0.5 - Reorderer problem

nicolaas.matthijs at caret.cam.ac.uk nicolaas.matthijs at caret.cam.ac.uk
Sun Oct 5 20:21:11 UTC 2008


This is the code I use:

======================

var grabHandleFinder, createAvatar, options;

grabHandleFinder = function(item){
  return jQuery("[id=draghandle_" + item.id + "]");
};

createAvatar = function(el){
  var div = document.createElement("div");
  var element = $(el);
  div.style.width = element.width() + "px";
  div.style.height = element.height() + "px";
  div.innerHTML = el.innerHTML;
  div.style.backgroundColor = "#EEEEEE";
  div.className = "widget_dragging";
  return div;
};

options = {
  styles:  {
    mouseDrag: "orderable-mouse-drag",
    dropMarker: "orderable-drop-marker-box",
    avatar: "orderable-avatar-clone"
  },
  selectors: {
    columns: ".groupWrapper",
    modules: ".widget1",
    grabHandle: grabHandleFinder,
  },
  listeners: {
    afterMove: saveState
  },
  avatarCreator: createAvatar
};

fluid.reorderLayout("#widgetscontainer", options);

======================

Interestingly, if I remove 'avatarCreator: createAvatar' from the options
and use the default avatar creator, everything works fine. (And it has
improved quite a lot, congratulations !). For me, the default one is just
fine, so I'm no longer blocked.

Nicolaas

> Quoting antranig at caret.cam.ac.uk:
>
> Hi there Nico - no, this isn't something I've seen before. Can you paste
> your options structure that you are passing to the Reorderer, in particular
> the section which defines the grab handle?
>
> Cheers,
> A.
>
> Quoting nicolaas.matthijs at caret.cam.ac.uk:
>
> > Thanks for the response Antranig. I have now found out that I had some
> > old version of the Fluid Keyboard a11y plugin included somewhere. If I
> > removed that one, it started working ...
> >
> > But I do see a different problem now. I am able to drag portlets around,
> > but if I drop one, and then immediately try to drag the same one again,
> > nothing happens and I get the following error :
> >
> > ========
> >
> > handlePos has no properties
> > [Break on this error] var handleMidX = handlePos[0] + handleWidth / 2;
> > GeometricManager.... (line 329)
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the fluid-work mailing list