#93 new
Jake Archibald

Sortable: allow horizontal sorting

Reported by Jake Archibald | August 17th, 2009 @ 10:58 AM | in 2.0

Make it easy to sort a set of floated / inline-block elements.

Comments and changes to this ticket

  • Jake Archibald

    Jake Archibald August 17th, 2009 @ 01:17 PM

    • Milestone set to 2.0
  • Fantix King

    Fantix King October 26th, 2009 @ 05:57 PM

    Glad to see this ticket. =)

    Not quite sure about this "floated / inline-block elements" - did you mean
    sortable elements with "float: left" or something like that?

    I actually tried to set every element with "float: left", as well as the
    target indicator. By default the pointer position detection doesn't work
    very well. However with a little bit tweaks over src/dragdrop/dragdrop.js,
    things just work like magic. ;)

  • Jake Archibald

    Jake Archibald October 26th, 2009 @ 07:38 PM

    Yeah, sortable elements with "float:left" or "display:inline-block".

    Interested to see the changes you made to dragdrop.js. I was saving this fix for Glow 2.0 as I'd like to rewrite dragdrop completely, but if you've got a quick fix to use in the mean time we'd like to roll it into the library (if you're happy for that to happen, that is).

  • Fantix King

    Fantix King October 27th, 2009 @ 01:56 AM

    I'm glad to be able to share something =)

    Attached a rough fix with some issues:
    * Position detection is acting weird sometimes. * Old vertical detection is probably broken. * Manual changes (float:left) to sortable elements and target indicator is needed. * Lack of tests.

    We are working on a project with this amazing library. Somehow
    horizontal sorting is required, so we are fixing the issues
    above. ;)

  • Fantix King

    Fantix King November 2nd, 2009 @ 04:41 AM

    Hi again :) I've made a few changes to the patch:

    • Added new line detection.
    • Fixed issue that position detection acts weird sometimes, by pre-loading the offsets on active.
    • Tested with old vertical detection.
    • Changed mouse position with central of Draggable in position detection.
    • Apply "float:left" to the placeholder automatically.

    Things left:

    • Support "display:inline-block".
    • Lack of tests.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A JavaScript Library

Shared Ticket Bins

People watching this ticket

Pages