diff --git a/djadmin2/static/themes/bootstrap/js/actions.js b/djadmin2/static/themes/bootstrap/js/actions.js index daf3f0b..9ee124f 100644 --- a/djadmin2/static/themes/bootstrap/js/actions.js +++ b/djadmin2/static/themes/bootstrap/js/actions.js @@ -9,8 +9,8 @@ $(function() { for (var ix = 0; ix < selectCheckboxen.length; ix++) { if ($(selectCheckboxen[ix]).prop('checked')) { count++; - }; - }; + } + } selectAllCheckbox.prop('checked', count == selectCheckboxen.length); selectedCount.text(count); }; @@ -23,4 +23,15 @@ $(function() { selectCheckboxen.click(function(e) { updateSelectedCount(); }); + + + var actionDropdownLink = element.find('.dropdown-menu a'); + actionDropdownLink.click(function (e) { + e.preventDefault(); + var form = $(this).closest('form'); + form.find('input[name="' + $(this).data('name') + '"]').val( + $(this).data('value')); + form.submit(); + }); + }); diff --git a/djadmin2/templates/admin2/bootstrap/model_list.html b/djadmin2/templates/admin2/bootstrap/model_list.html index 5c5ec16..096a9c8 100644 --- a/djadmin2/templates/admin2/bootstrap/model_list.html +++ b/djadmin2/templates/admin2/bootstrap/model_list.html @@ -19,16 +19,22 @@