mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Removed one line ifs and elses. (#11389)
This commit is contained in:
@@ -6,17 +6,21 @@ function replaceContent() {
|
||||
var id = args\[0\];
|
||||
var content = args\[1\];
|
||||
var callback = null;
|
||||
if(args\[2\]){
|
||||
if(args\[2\])
|
||||
{
|
||||
callback = args\[2\];
|
||||
if(args\[3\]){
|
||||
if(args\[3\])
|
||||
{
|
||||
args = args.slice(3);
|
||||
}
|
||||
}
|
||||
var parent = document.getElementById(id);
|
||||
if(typeof(parent)!=='undefined' && parent!=null){
|
||||
if(typeof(parent)!=='undefined' && parent!=null)
|
||||
{
|
||||
parent.innerHTML = content?content:'';
|
||||
}
|
||||
if(callback && window\[callback\]){
|
||||
if(callback && window\[callback\])
|
||||
{
|
||||
window\[callback\].apply(null,args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,26 +4,31 @@ function dropdowns() {
|
||||
var headers = new Array();
|
||||
var links = new Array();
|
||||
for(var i=0;i<divs.length;i++){
|
||||
if(divs\[i\].className=='header') {
|
||||
if(divs\[i\].className=='header')
|
||||
{
|
||||
divs\[i\].className='header closed';
|
||||
divs\[i\].innerHTML = divs\[i\].innerHTML+' +';
|
||||
headers.push(divs\[i\]);
|
||||
}
|
||||
if(divs\[i\].className=='links') {
|
||||
if(divs\[i\].className=='links')
|
||||
{
|
||||
divs\[i\].className='links hidden';
|
||||
links.push(divs\[i\]);
|
||||
}
|
||||
}
|
||||
for(var i=0;i<headers.length;i++){
|
||||
if(typeof(links\[i\])!== 'undefined' && links\[i\]!=null) {
|
||||
if(typeof(links\[i\])!== 'undefined' && links\[i\]!=null)
|
||||
{
|
||||
headers\[i\].onclick = (function(elem) {
|
||||
return function() {
|
||||
if(elem.className.search('visible')>=0) {
|
||||
if(elem.className.search('visible')>=0)
|
||||
{
|
||||
elem.className = elem.className.replace('visible','hidden');
|
||||
this.className = this.className.replace('open','closed');
|
||||
this.innerHTML = this.innerHTML.replace('-','+');
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
elem.className = elem.className.replace('hidden','visible');
|
||||
this.className = this.className.replace('closed','open');
|
||||
this.innerHTML = this.innerHTML.replace('+','-');
|
||||
|
||||
Reference in New Issue
Block a user