clicked class working now

This commit is contained in:
Cristina Cochior 2020-10-10 18:37:49 +02:00
parent 45c0aa899a
commit baf8d14ccf

View File

@ -310,40 +310,52 @@ $.ajax({
}; };
var methodList = getAllUrlParams().method; var methodList = getAllUrlParams().method;
alert(methodList);
var libList = getAllUrlParams().librarian; var libList = getAllUrlParams().librarian;
alert(libList);
if ( (typeof methodList === 'undefined') && (typeof libList === 'undefined')) {
} else {
if (typeof libList !== 'undefined') {
if (Array.isArray(libList)===false) { if (Array.isArray(libList)===false) {
var search_id0 = libList; var search_id0 = libList;
var element0 = document.getElementById(search_id0); var element0 = document.getElementById(search_id0);
element0.classList.add("clicked"); element0.classList.add("clicked");
// alert(search_id0); // alert(search_id0);
} else { } else {
for (i=0; i < libList.length ; i++) { for (i=0; i < libList.length ; i++) {
var search_id = libList[i]; var search_id = libList[i];
var element = document.getElementById(search_id); var element = document.getElementById(search_id);
element.classList.add("clicked"); element.classList.add("clicked");
// alert(i); // alert(i);
}
};
}; };
if (Array.isArray(methodList)===false) { if (typeof methodList !== 'undefined') {
if (Array.isArray(methodList)===false) { // is not array
var search_meth0 = methodList; var search_meth0 = methodList;
var elementy0 = document.getElementById(search_meth0); var elementy0 = document.getElementById(search_meth0);
elementy0.classList.add("methodclicked"); elementy0.classList.add("methodclicked");
// alert(search_meth0); } else { // is array
} else {
for (y=0; y < methodList.length ; y++) { for (y=0; y < methodList.length ; y++) {
var search_meth = methodList[y]; var search_meth = methodList[y];
var elementy = document.getElementById(search_meth); var elementy = document.getElementById(search_meth);
elementy.classList.add("methodclicked"); elementy.classList.add("methodclicked");
} }
}; };
};
};
}); });
</script> </script>
</body> </body>