diff --git a/README.md b/README.md index ec89d47..85a5db6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/iambrandontaylor/django-admin-sortable.svg?branch=master)](https://travis-ci.org/iambrandontaylor/django-admin-sortable) -Current version: 2.0.12 +Current version: 2.0.13 This project makes it easy to add drag-and-drop ordering to any model in Django admin. Inlines for a sortable model may also be made sortable, @@ -497,8 +497,8 @@ ordering on top of that just seemed a little much in my opinion. django-admin-sortable is currently used in production. -### What's new in 2.0.12? -- Fixed an issue with CSRF_COOKIE_NAME not being passed correctly to inlines. Thanks [@Hovercross](https://github.com/Hovercross) for reporting the issue. +### What's new in 2.0.13? +- Fixed an issue where the index_value for sortable stacked inlines might not have been found. ### Future diff --git a/README.rst b/README.rst index b935619..b56f948 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ Django Admin Sortable |Build Status| -Current version: 2.0.12 +Current version: 2.0.13 This project makes it easy to add drag-and-drop ordering to any model in Django admin. Inlines for a sortable model may also be made sortable, @@ -611,12 +611,11 @@ Status django-admin-sortable is currently used in production. -What's new in 2.0.12? +What's new in 2.0.13? ~~~~~~~~~~~~~~~~~~~~~ -- Fixed an issue with CSRF\_COOKIE\_NAME not being passed correctly to - inlines. Thanks [@Hovercross](https://github.com/Hovercross) for - reporting the issue. +- Fixed an issue where the index\_value for sortable stacked inlines + might not have been found. Future ~~~~~~ diff --git a/adminsortable/__init__.py b/adminsortable/__init__.py index a3e057f..24c3011 100644 --- a/adminsortable/__init__.py +++ b/adminsortable/__init__.py @@ -1,4 +1,4 @@ -VERSION = (2, 0, 12) +VERSION = (2, 0, 13) DEV_N = None diff --git a/adminsortable/static/adminsortable/js/admin.sortable.tabular.inlines.js b/adminsortable/static/adminsortable/js/admin.sortable.tabular.inlines.js index b39190d..376df13 100644 --- a/adminsortable/static/adminsortable/js/admin.sortable.tabular.inlines.js +++ b/adminsortable/static/adminsortable/js/admin.sortable.tabular.inlines.js @@ -4,7 +4,7 @@ var sorting_urls = $(':hidden[name="admin_sorting_url"]'); if (sorting_urls.length) { - var sortable_inline_group = sorting_urls.closest('.inline-group') + var sortable_inline_group = sorting_urls.closest('.inline-group'); var tabular_inline_rows = sortable_inline_group.find('.tabular table tbody tr'); tabular_inline_rows.addClass('sortable'); @@ -27,8 +27,8 @@ var indexes = []; ui.item.parent().children('tr').each(function(i) { - var index_value = $(this).find('.original').find(':input').first().val(); - if (index_value !== '' && index_value !== undefined) { + var index_value = $(this).find('.original :input:first').val(); + if (index_value !== '' && index_value !== undefined) { indexes.push(index_value); } });