mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-57125 comment: prevent js execution if there are no comments
This commit is contained in:
parent
5ef81f2b0b
commit
1f8d39893f
@ -410,19 +410,21 @@ M.core_comment = {
|
||||
},
|
||||
init_admin: function(Y) {
|
||||
var select_all = Y.one('#comment_select_all');
|
||||
select_all.on('click', function(e) {
|
||||
var comments = document.getElementsByName('comments');
|
||||
var checked = false;
|
||||
for (var i in comments) {
|
||||
if (comments[i].checked) {
|
||||
checked=true;
|
||||
if (select_all) {
|
||||
select_all.on('click', function(e) {
|
||||
var comments = document.getElementsByName('comments');
|
||||
var checked = false;
|
||||
for (var i in comments) {
|
||||
if (comments[i].checked) {
|
||||
checked=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i in comments) {
|
||||
comments[i].checked = !checked;
|
||||
}
|
||||
this.set('checked', !checked);
|
||||
});
|
||||
for (i in comments) {
|
||||
comments[i].checked = !checked;
|
||||
}
|
||||
this.set('checked', !checked);
|
||||
});
|
||||
}
|
||||
|
||||
var comments_delete = Y.one('#comments_delete');
|
||||
if (comments_delete) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user