From 2c4fc9c8bdbedeecb9536fd2f5223512f62a32e1 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 23 May 2013 11:23:19 +0300 Subject: [ticket/11562] Convert marklist() to jQuery PHPBB3-11562 --- phpBB/styles/prosilver/template/forum_fn.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'phpBB/styles') diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index eccb12e827..8f99fe5c60 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -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); } - } + }); } /** -- cgit v1.2.1