From 8e7691ee95c2c4c680e11885e7a1b0135860efbc Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Thu, 18 May 2023 16:09:42 +0200 Subject: [PATCH] Cleaned up code --- Frontend/assets/scripts/tools/mock/uianimation.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Frontend/assets/scripts/tools/mock/uianimation.js b/Frontend/assets/scripts/tools/mock/uianimation.js index 432673a..b8aed5c 100644 --- a/Frontend/assets/scripts/tools/mock/uianimation.js +++ b/Frontend/assets/scripts/tools/mock/uianimation.js @@ -120,14 +120,14 @@ async function formatXML(xml) { } function showRequestBody(element){ - requestBody = ""; - document.getElementById('code-highlight-content').innerText = "Loading..."; var historyRequestBody = historyJson[element.id].requestBody; + const popupContent = document.getElementById('code-highlight-content') + + document.getElementById('code-highlight-content').innerText = "Loading..."; switch(historyJson[element.id].headers["content-type"]){ case "application/json":{ formatJSON(historyRequestBody).then(function(result) { - document.getElementById('code-highlight-content').innerText = result.data; - console.log(result.data); + popupContent.innerText = result.data; highlightSyntax('code-highlight-content'); }); break; @@ -135,11 +135,11 @@ function showRequestBody(element){ case "application/xml":{ formatXML(historyRequestBody).then(function(result) { if (result.status == "OK") { - document.getElementById('code-highlight-content').innerText = result.result; + popupContent.innerText = result.result; highlightSyntax('code-highlight-content'); } else { - document.getElementById('code-highlight-content').innerText = historyRequestBody; + popupContent.innerText = historyRequestBody; } }); @@ -147,7 +147,7 @@ function showRequestBody(element){ break; } default:{ - document.getElementById('code-highlight-content').innerText = historyRequestBody; + popupContent.innerText = historyRequestBody; highlightSyntax('code-highlight-content'); } }