Skip to content

Commit

Permalink
Fix issue with sorting of non-polymorphic inlines in polymorphic inlines
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Apr 3, 2019
1 parent ae19a68 commit da0b800
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions nested_admin/static/nested_admin/dist/nested_admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nested_admin/static/nested_admin/dist/nested_admin.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nested_admin/static/nested_admin/dist/nested_admin.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions nested_admin/static/nested_admin/src/nested-admin/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function createSortable($group) {
},
helper: 'clone',
opacity: 0.6,
maxLevels: 3,
maxLevels: 0,
connectWith: '.djn-items',
tolerance: 'intersection',
// Don't allow dragging beneath an inline that is marked for deletion
Expand All @@ -172,7 +172,7 @@ function createSortable($group) {
if (isPolymorphic) {
const childModels = parentItem.closest('.djn-group').data('inlineFormset').nestedOptions.childModels;
const inlineModel = currentItem.data('inlineModel');
if (childModels.indexOf(inlineModel) === -1) {
if (childModels && childModels.indexOf(inlineModel) === -1) {
return false;
}
}
Expand Down
1 change: 1 addition & 0 deletions nested_admin/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
'DIRS': selenosis.settings.TEMPLATES[0]['DIRS'],
'APP_DIRS': True,
'OPTIONS': {
'debug': True,
'string_if_invalid': 'INVALID {{ %s }}',
'context_processors': [
'django.contrib.auth.context_processors.auth',
Expand Down

0 comments on commit da0b800

Please sign in to comment.