Fixed #10782 -- Fixed a Javascript error in the admin.
Viewing an empty changelist page no longer attempts to attach event listeners to an undefined object. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10515 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8dc73e8425
commit
f4072f5be8
|
@ -8,6 +8,7 @@ var Actions = {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var changelistTable = document.getElementsBySelector('#changelist table')[0];
|
var changelistTable = document.getElementsBySelector('#changelist table')[0];
|
||||||
|
if (changelistTable) {
|
||||||
addEvent(changelistTable, 'click', function(e) {
|
addEvent(changelistTable, 'click', function(e) {
|
||||||
if (!e) { var e = window.event; }
|
if (!e) { var e = window.event; }
|
||||||
var target = e.target ? e.target : e.srcElement;
|
var target = e.target ? e.target : e.srcElement;
|
||||||
|
@ -17,6 +18,7 @@ var Actions = {
|
||||||
Actions.toggleRow(tr, target.checked);
|
Actions.toggleRow(tr, target.checked);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toggleRow: function(tr, checked) {
|
toggleRow: function(tr, checked) {
|
||||||
if (checked && tr.className.indexOf('selected') == -1) {
|
if (checked && tr.className.indexOf('selected') == -1) {
|
||||||
|
|
Loading…
Reference in New Issue