Fixed bug with category not bein remembered

This commit is contained in:
2023-05-26 10:44:54 +02:00
parent 45fab20cc4
commit d336f5d18e

View File

@@ -87,8 +87,18 @@ function changeActiveTools(activeCategoryButton) {
function changeTool(tool) { function changeTool(tool) {
const url = tools.get(tool); const url = tools.get(tool);
localStorage.setItem("lastPage", tool); localStorage.setItem("lastPage", tool);
document.getElementById("iframe").src = url;
switch (tool) { // XML category is default.
case "jsonform":
changeActiveTools('JSON');
break;
case "mock":
changeActiveTools('REST');
break;
}
document.location.search = tool; document.location.search = tool;
document.getElementById("iframe").src = url;
} }
/** /**
@@ -104,15 +114,5 @@ function loadLastPage() {
if (lastPage == null) { if (lastPage == null) {
lastPage = "xpath"; lastPage = "xpath";
} }
changeTool(lastPage);
switch (lastPage) { // XML category is default.
case "jsonform":
changeActiveTools('JSON');
break;
case "mock":
changeActiveTools('REST');
break;
}
document.getElementById("iframe").src = tools.get(lastPage);
} }