From 87226b1f368c3065a42c256a9d9f7f09382126d4 Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Wed, 9 Oct 2024 20:28:40 +0100 Subject: [PATCH] Fixed issue #24 Fixed issue with audit logs going into wrong location --- cms/js/cms.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cms/js/cms.js b/cms/js/cms.js index 07e3f32..551225d 100644 --- a/cms/js/cms.js +++ b/cms/js/cms.js @@ -68,10 +68,11 @@ $(document).ready(function () { // Handle Saving changes to the page $('#savePage').click(() => { + frameContainer=$('#frameContainer').contents().get(0) $.post("/cms/controller/", { action: "save", - uri: $('#frameContainer').contents().get(0).location.pathname, - content: new XMLSerializer().serializeToString($('#frameContainer').contents().get(0)) + uri: frameContainer.location.pathname, + content: new XMLSerializer().serializeToString(frameContainer) }, function (data) { if (typeof data.error == "undefined") { showMessage(data.message, "success"); @@ -165,8 +166,7 @@ $(document).ready(function () { // Add click event to list items to redirect $("#fileList li").click(function () { - const fileUrl = $(this).data("url"); - $('#frameContainer').contents().get(0).location.href = fileUrl; // Redirect to the clicked file's URL + $('#frameContainer').contents().get(0).location.href = $(this).data("url"); // Redirect to the clicked file's URL $("#fileListDialog").dialog("close"); // Close the modal }); },