Skip to content

Commit

Permalink
fixes tab behavior when changing example
Browse files Browse the repository at this point in the history
  • Loading branch information
joaovictor3g committed Apr 26, 2024
1 parent 2667428 commit 4e989c6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions web/assets/js/utils/render-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import { hideAccordions } from "../components/accordions/result.js";
import { createTooltip } from "../components/tooltips/index.js";
import { localStorageModeKey } from "../constants.js";
import { AceEditor } from "../editor.js";
import { setEditorTheme } from "../theme.js";
import { getCurrentMode } from "./localStorage.js";
Expand Down Expand Up @@ -259,11 +258,10 @@ function getCurrentExample(mode, examples) {
}

function resetTabs() {
document.getElementById("tabs").setAttribute("style", "--current-tab: 0");
document.querySelectorAll(".tabs-button").forEach((tabButton, i) => {
if (i === 0) {
tabButton.parentElement.setAttribute("style", `--current-tab: ${i}`);
tabButton.classList.add("active");
} else tabButton.classList.remove("active");
if (i === 0) tabButton.classList.add("active");
else tabButton.classList.remove("active");
});

document.querySelectorAll(dataEditorInputClassNames).forEach((editor, i) => {
Expand Down

0 comments on commit 4e989c6

Please sign in to comment.