Skip to content
Snippets Groups Projects
Commit 442bc255 authored by Liliana Sanfilippo's avatar Liliana Sanfilippo
Browse files

Did // eventuell noch eine dritte optionale variable was sonst noch alles geschlossen werden soll

//also wenn tabtabs gewechselt wird sollen alle tabbys geschlossen werden
parent a02b48b6
No related branches found
No related tags found
No related merge requests found
Pipeline #394582 passed
......@@ -79,11 +79,11 @@ export function HPButtonrow(){
return(
<>
<div className="align-items-center bottom-buttons">
<button className="active" onClick={openTab({cityName: "All", cla: "tabtabs"})}> All</button>
<button onClick={openTab({cityName: "Patient", cla: "tabtabs"})}> Patients</button>
<button onClick={openTab({cityName: "Academia", cla: "tabtabs"})}> Academia</button>
<button onClick={openTab({cityName: "Medical", cla: "tabtabs"})}> Medical professionals</button>
<button onClick={openTab({cityName: "Industry", cla: "tabtabs"})}> Industry</button>
<button className="active" onClick={openTab({cityName: "All", cla: "tabtabs", weg:"tabbys"})}> All</button>
<button onClick={openTab({cityName: "Patient", cla: "tabtabs", weg:"tabbys"})}> Patients</button>
<button onClick={openTab({cityName: "Academia", cla: "tabtabs", weg:"tabbys"})}> Academia</button>
<button onClick={openTab({cityName: "Medical", cla: "tabtabs", weg:"tabbys"})}> Medical professionals</button>
<button onClick={openTab({cityName: "Industry", cla: "tabtabs", weg:"tabbys"})}> Industry</button>
</div>
</>
)
......
......@@ -102,8 +102,7 @@ let tabtabs = [
}
]
// eventuell noch eine dritte optionale variable was sonst noch alles geschlossen werden soll
//also wenn tabtabs gewechselt wird sollen alle tabbys geschlossen werden
export function HumanPractices() {
openTab({cityName: "All", cla: "tabtabs"});
return (
......@@ -116,9 +115,9 @@ export function HumanPractices() {
);
}
export function openTab({cityName, cla}:{cityName: string, cla: string}) {
export function openTab({cityName, cla, weg}:{cityName: string, cla: string, weg?: string}) {
const opencity = (event : React.MouseEvent<HTMLButtonElement, MouseEvent>) =>{
var i, tabcontent, tablinks;
var i, tabcontent, tablinks, wegcontent;
tabcontent = document.getElementsByClassName(cla);
for (i = 0; i < tabcontent.length; i++) {
(tabcontent[i] as HTMLElement).style.display = "none";
......@@ -127,6 +126,12 @@ export function openTab({cityName, cla}:{cityName: string, cla: string}) {
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
if (weg){
wegcontent = document.getElementsByClassName(weg);
for (i = 0; i < wegcontent.length; i++) {
(wegcontent[i] as HTMLElement).style.display = "none";
}
}
document.getElementById(cityName)!.style.display = "block";
event.currentTarget.className += " active";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment