Skip to content

Commit

Permalink
Update active IDE when clicking on another while open
Browse files Browse the repository at this point in the history
  • Loading branch information
s-fristrom committed Sep 21, 2024
1 parent e2b3ff6 commit 927ed05
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion starter-frontend/src/pages/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,18 @@ export function Note(): JSX.Element {
}

function openIDE(this: HTMLButtonElement, ev: MouseEvent): void {


// @ts-ignore
if (ev.target !== null && ev.target.className !== null && ev.target.className === "run-in-ide-btn") {
// @ts-ignore
const editor = ev.target.getRootNode();
const oldActive = editor.getElementById("active");
if (oldActive !== null) {
oldActive.setAttribute("id", "");
}


// @ts-ignore
const parentDiv = ev.target.parentNode;
if (parentDiv !== null) {
Expand All @@ -88,7 +98,7 @@ export function Note(): JSX.Element {
setInitIDELang(Number(language));
}

setIsIDEOpen(true);
setIsIDEOpen(true);
}
}
}
Expand Down

0 comments on commit 927ed05

Please sign in to comment.