Merged widlam/refactor/issue#201 to master
This commit is contained in:
@@ -83,12 +83,21 @@ function changeActiveTools(activeCategoryButton) {
|
||||
* @returns {void}
|
||||
*/
|
||||
function changeTool(tool) {
|
||||
if (tools.has(tool)) {
|
||||
const url = tools.get(tool);
|
||||
document.location.search = tool + "/";
|
||||
localStorage.setItem("lastPage", tool);
|
||||
document.getElementById("iframe").src = url;
|
||||
if (! tools.has(tool)) return;
|
||||
const url = tools.get(tool);
|
||||
localStorage.setItem("lastPage", tool);
|
||||
|
||||
switch (tool) { // XML category is default.
|
||||
case "jsonform":
|
||||
changeActiveTools('JSON');
|
||||
break;
|
||||
case "mock":
|
||||
changeActiveTools('REST');
|
||||
break;
|
||||
|
||||
}
|
||||
document.location.search = tool;
|
||||
document.getElementById("iframe").src = url;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,15 +113,5 @@ function loadLastPage() {
|
||||
if (lastPage == null) {
|
||||
lastPage = "xpath";
|
||||
}
|
||||
|
||||
switch (lastPage) { // XML category is default.
|
||||
case "jsonform":
|
||||
changeActiveTools('JSON');
|
||||
break;
|
||||
case "mock":
|
||||
changeActiveTools('REST');
|
||||
break;
|
||||
|
||||
}
|
||||
document.getElementById("iframe").src = tools.get(lastPage);
|
||||
changeTool(lastPage);
|
||||
}
|
||||
Reference in New Issue
Block a user