Skip to content

Commit da0b800

Browse files
committed
Fix issue with sorting of non-polymorphic inlines in polymorphic inlines
1 parent ae19a68 commit da0b800

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

nested_admin/static/nested_admin/dist/nested_admin.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nested_admin/static/nested_admin/dist/nested_admin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nested_admin/static/nested_admin/dist/nested_admin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nested_admin/static/nested_admin/dist/nested_admin.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nested_admin/static/nested_admin/src/nested-admin/sortable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function createSortable($group) {
161161
},
162162
helper: 'clone',
163163
opacity: 0.6,
164-
maxLevels: 3,
164+
maxLevels: 0,
165165
connectWith: '.djn-items',
166166
tolerance: 'intersection',
167167
// Don't allow dragging beneath an inline that is marked for deletion
@@ -172,7 +172,7 @@ function createSortable($group) {
172172
if (isPolymorphic) {
173173
const childModels = parentItem.closest('.djn-group').data('inlineFormset').nestedOptions.childModels;
174174
const inlineModel = currentItem.data('inlineModel');
175-
if (childModels.indexOf(inlineModel) === -1) {
175+
if (childModels && childModels.indexOf(inlineModel) === -1) {
176176
return false;
177177
}
178178
}

nested_admin/tests/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
'DIRS': selenosis.settings.TEMPLATES[0]['DIRS'],
5454
'APP_DIRS': True,
5555
'OPTIONS': {
56+
'debug': True,
5657
'string_if_invalid': 'INVALID {{ %s }}',
5758
'context_processors': [
5859
'django.contrib.auth.context_processors.auth',

0 commit comments

Comments
 (0)