Ticket #11697: shift-check-multi.diff
File shift-check-multi.diff, 1.8 KB (added by , 15 years ago) |
---|
-
django/contrib/admin/media/js/actions.js
4 4 counterContainer = document.getElementsBySelector('span.action_counter'); 5 5 actionCheckboxes = document.getElementsBySelector('tr input.action-select'); 6 6 selectAll = document.getElementById('action-toggle'); 7 lastChecked = null; 7 8 for(var i = 0; i < counterContainer.length; i++) { 8 9 counterContainer[i].style.display = 'inline'; 9 10 } … … 18 19 addEvent(actionCheckboxes[i], 'click', function() { 19 20 Actions.counter(); 20 21 }); 22 addEvent(actionCheckboxes[i], 'click', function(e) { 23 if (!e) { var e = window.event; } 24 var target = e.target ? e.target : e.srcElement; 25 if (e.shiftKey == true) { 26 var inrange = false; 27 for (var i = 0; i < actionCheckboxes.length; i++) { 28 if (actionCheckboxes[i] == lastChecked || actionCheckboxes[i] == target) { 29 inrange = (inrange) ? false : true; 30 } 31 if (inrange) { 32 actionCheckboxes[i].checked = target.checked; 33 Actions.toggleRow(actionCheckboxes[i].parentNode.parentNode, target.checked); 34 } 35 } 36 } 37 lastChecked = target; 38 }); 21 39 } 22 40 var changelistTable = document.getElementsBySelector('#changelist table')[0]; 23 41 if (changelistTable) {