Skip to content

Commit

Permalink
novnc iframe src updating (#482)
Browse files Browse the repository at this point in the history
Added a check for the Workspace Deskop and if found replacing the src of the url to get a smoother experience while using the control panel.
  • Loading branch information
JensHouses authored Jul 25, 2024
1 parent 02359be commit 08ca3fe
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dojo_theme/static/js/dojo/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ function DropdownStartChallenge(event) {
await updateNavbarDropdown();
$(".challenge-active").removeClass("challenge-active");
$(`.accordion-item input[value=${params.challenge}]`).closest(".accordion-item").find("h4.challenge-name").addClass("challenge-active");
if (window.location.href.includes('/workspace/desktop')) {
let iframe_html = await fetch('/workspace/desktop').then(response => response.text());
let iframe_src = $(iframe_html).find("iframe").attr("src");
if (iframe_src) {
$("main iframe").attr("src", iframe_src);
}
}
}
else {
let message = "Error:";
Expand Down

0 comments on commit 08ca3fe

Please sign in to comment.