diff --git a/suit/sortables.py b/suit/sortables.py index 5b3adbc3..95048b3b 100644 --- a/suit/sortables.py +++ b/suit/sortables.py @@ -13,7 +13,7 @@ class SortableModelAdminBase(object): sortable = 'order' class Media: - js = ('suit/js/suit.sortables.js',) + js = ('admin/js/jquery.init.js', 'suit/js/suit.sortables.js') class SortableListForm(ModelForm): diff --git a/suit/static/suit/js/suit.sortables.js b/suit/static/suit/js/suit.sortables.js index 4953ed6e..9e7c3074 100644 --- a/suit/static/suit/js/suit.sortables.js +++ b/suit/static/suit/js/suit.sortables.js @@ -2,7 +2,7 @@ * List sortables */ (function ($) { - $.fn.suit_list_sortable = function () { + $.fn.suit_list_sortable = function (selector) { var $inputs = $(this); if (!$inputs.length) return; @@ -137,7 +137,6 @@ // Update input count right before submit if ($inputs && $inputs.length) { var $last_input = $inputs.last(); - var selector = $(this).selector; $($last_input[0].form).submit(function (e) { var i = 0, value; // e.preventDefault(); @@ -172,7 +171,7 @@ $(function () { - $('.suit-sortable').suit_list_sortable(); + $('.suit-sortable').suit_list_sortable('.suit-sortable'); }); }(django.jQuery));