Files
Bubberstation/code/_js/menus.dm
Jeremiah 872e64fb05 Adds spaces around logical operators (#72603)
## About The Pull Request
Part of a prior PR that was closed (#72562). This version does not add
the check in CI.
## Why It's Good For The Game
The work is already done, so I figured why not.
## Changelog
N/A Nothing player facing

Co-authored-by: Jeremiah Snow <jlsnow301@pm.me>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2023-01-16 16:56:35 -08:00

38 lines
1.1 KiB
Plaintext

#define js_dropdowns {"
function dropdowns() {
var divs = document.getElementsByTagName('div');
var headers = new Array();
var links = new Array();
for(var i=0;i<divs.length;i++){
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') {
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) {
headers\[i\].onclick = (function(elem) {
return function() {
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 {
elem.className = elem.className.replace('hidden','visible');
this.className = this.className.replace('closed','open');
this.innerHTML = this.innerHTML.replace('+','-');
}
return false;
}
})(links\[i\]);
}
}
}
"}