mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11562] Convert marklist() to jQuery
PHPBB3-11562
This commit is contained in:
parent
afc12906b9
commit
2c4fc9c8bd
1 changed files with 5 additions and 12 deletions
|
@ -42,19 +42,12 @@ function jumpto() {
|
|||
* id = ID of parent container, name = name prefix, state = state [true/false]
|
||||
*/
|
||||
function marklist(id, name, state) {
|
||||
var parent = document.getElementById(id) || document[id];
|
||||
|
||||
if (!parent) {
|
||||
return;
|
||||
}
|
||||
|
||||
var rb = parent.getElementsByTagName('input');
|
||||
|
||||
for (var r = 0; r < rb.length; r++) {
|
||||
if (rb[r].name.substr(0, name.length) === name) {
|
||||
rb[r].checked = state;
|
||||
}
|
||||
jQuery('#' + id + ' input[type=checkbox][name]').each(function() {
|
||||
var $this = jQuery(this);
|
||||
if ($this.attr('name').substr(0, name.length) == name) {
|
||||
$this.prop('checked', state);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue