django1/django/contrib/admin/media/js/actions.js

20 lines
600 B
JavaScript
Raw Normal View History

var Actions = {
init: function() {
selectAll = document.getElementById('action-toggle');
if (selectAll) {
selectAll.style.display = 'inline';
addEvent(selectAll, 'click', function() {
Actions.checker(selectAll.checked);
});
}
},
checker: function(checked) {
actionCheckboxes = document.getElementsBySelector('tr input.action-select');
for(var i = 0; i < actionCheckboxes.length; i++) {
actionCheckboxes[i].checked = checked;
}
}
}
addEvent(window, 'load', Actions.init);