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]
|
* id = ID of parent container, name = name prefix, state = state [true/false]
|
||||||
*/
|
*/
|
||||||
function marklist(id, name, state) {
|
function marklist(id, name, state) {
|
||||||
var parent = document.getElementById(id) || document[id];
|
jQuery('#' + id + ' input[type=checkbox][name]').each(function() {
|
||||||
|
var $this = jQuery(this);
|
||||||
if (!parent) {
|
if ($this.attr('name').substr(0, name.length) == name) {
|
||||||
return;
|
$this.prop('checked', state);
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue