diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/pages/index.html b/wagtail/wagtailadmin/templates/wagtailadmin/pages/index.html index 3a3aa49a77..0f1011f1d4 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/pages/index.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/pages/index.html @@ -9,12 +9,12 @@ {% include "wagtailadmin/shared/breadcrumb.html" with page=parent_page %} - +
{% endblock %} @@ -30,9 +30,10 @@ var orderform = $('#page-reorder-form'); $('.listing tbody').sortable({ - cursor: "move", - containment: "parent", - handle: ".handle", + cursor: "move", + tolerance: "pointer", + containment: "parent", + handle: ".handle", items: "> tr", axis: "y", placeholder: "dropzone", diff --git a/wagtail/wagtailadmin/views/pages.py b/wagtail/wagtailadmin/views/pages.py index 53810fa3cc..bad91a990d 100644 --- a/wagtail/wagtailadmin/views/pages.py +++ b/wagtail/wagtailadmin/views/pages.py @@ -634,8 +634,13 @@ def set_page_position(request, page_to_move_id): # so don't bother to catch InvalidMoveToDescendant if position_page: - # Move page into this position - page_to_move.move(position_page, pos='left') + # If the page has been moved to the right, insert it to the + # right. If left, then left. + old_position = list(parent_page.get_children()).index(page_to_move) + if int(position) < old_position: + page_to_move.move(position_page, pos='left') + elif int(position) > old_position: + page_to_move.move(position_page, pos='right') else: # Move page to end page_to_move.move(parent_page, pos='last-child')