Skip to content

Commit 41f3840

Browse files
Hide move to * page actions when all objects are displayed
1 parent f3dc641 commit 41f3840

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

adminsortable2/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def get_urls(self):
8585
def get_actions(self, request):
8686
actions = super(SortableAdminMixin, self).get_actions(request)
8787
paginator = self.get_paginator(request, self.get_queryset(request), self.list_per_page)
88-
if len(paginator.page_range) > 1:
88+
if len(paginator.page_range) > 1 and 'all' not in request.GET:
8989
# add actions for moving items to other pages
9090
move_actions = []
9191
cur_page = int(request.GET.get('p', 0)) + 1

adminsortable2/static/adminsortable2/js/list-sortable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jQuery(function($) {
4444
});
4545
endindex = dragged_rows.item.index()
4646

47-
var startorder = parseInt($(dragged_rows.item.context).find('div.drag').attr('order'));
47+
startorder = $(dragged_rows.item.context).find('div.drag').attr('order');
4848
if (startindex == endindex) return;
4949
else if (endindex == 0) {
5050
if (ordering === '1' || ordering === undefined)

0 commit comments

Comments
 (0)