[ticket/11562] Use jQuery in subPanels

PHPBB-11562
This commit is contained in:
Vjacheslav Trushkin 2013-05-23 12:18:06 +03:00
parent d091c4f829
commit 2624d1ea14

View file

@ -117,29 +117,15 @@ jQuery(document).ready(function() {
} }
function subPanels(p) { function subPanels(p) {
var i, e, t; var i;
if (typeof(p) === 'string') { if (typeof(p) === 'string') {
show_panel = p; show_panel = p;
} }
for (i = 0; i < panels.length; i++) { for (i = 0; i < panels.length; i++) {
e = document.getElementById(panels[i]); jQuery('#' + panels[i]).css('display', panels[i] === show_panel ? 'block' : 'none');
t = document.getElementById(panels[i] + '-tab'); jQuery('#' + panels[i] + '-tab').toggleClass('activetab', panels[i] === show_panel);
if (e) {
if (panels[i] === show_panel) {
e.style.display = 'block';
if (t) {
t.className = 'activetab';
}
} else {
e.style.display = 'none';
if (t) {
t.className = '';
}
}
}
} }
} }
}); });