Ticket #11515: django-admin-actions.2.patch
File django-admin-actions.2.patch, 1.2 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/media/js/actions.js
1 1 var Actions = { 2 2 init: function() { 3 3 4 var selectAll = document.getElementById('action-toggle'); 4 5 if (selectAll) { 5 6 selectAll.style.display = 'inline'; … … 19 20 } 20 21 }); 21 22 } 23 24 var actionCheckboxes = document.getElementsBySelector('#changelist table tbody tr td .action-select'); 25 for(var i = 0; i < actionCheckboxes.length; i++){ 26 var checkbox = actionCheckboxes[i] 27 var tr = checkbox.parentNode.parentNode; 28 Actions.toggleRow(tr, checkbox.checked); 29 } 22 30 }, 23 31 toggleRow: function(tr, checked) { 32 24 33 if (checked && tr.className.indexOf('selected') == -1) { 25 34 tr.className += ' selected'; 26 35 } else if (!checked) { … … 28 37 } 29 38 }, 30 39 checker: function(checked) { 40 31 41 var actionCheckboxes = document.getElementsBySelector('tr input.action-select'); 32 42 for(var i = 0; i < actionCheckboxes.length; i++) { 33 43 actionCheckboxes[i].checked = checked;