torchbox/wagtail — pull request #665 by mope (2014-10-02 10:37:59+00:00)
Title: Fix page reordering in Wagtail Admin

This pull request fixes two bugs found while investigating issue #661.

1) Jquery UI's Sortable plugin would sometimes not detect that an item had been moved into the first or last position of the list, depending on the exact position of the mouse pointer.
2) Newly-moved pages were always inserted to the left of pages whose old position they were supposed to occupy. So given a list of the form:

*foo bar baz*

Moving *foo* into *baz*'s position,

*bar foo baz*

Resulted in *foo* being inserted to the left of *baz*, giving:

*foo bar baz*

**Fixes**:

1) Change the 'tolerance' setting on Jquery UI's Sortable plugin so that it can detect when an item has been pulled into the first or last position in a list.
2) Detect whether a page was moved to the right or to the left. Insert it to the right if right, left if left.