From 3a87bf104aeaddfcdcf366236b6ccbe3a1bced9e Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Wed, 9 Oct 2024 20:35:17 +0100 Subject: [PATCH] ..and more code --- cms/js/cms.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cms/js/cms.js b/cms/js/cms.js index 551225d..0c0c4dd 100644 --- a/cms/js/cms.js +++ b/cms/js/cms.js @@ -18,9 +18,11 @@ $(document).ready(function () { // Get the content of the div var content = currentDiv.html(); - // Set the content in TinyMCE, Show the modal and initialise TinyMCE - $('#editor').val(content) - .modal('show') + // Set the content in TinyMCE + $('#editor').val(content); + + // Open the modal and init tinyMCE + $('#editModal').modal('show') .on('shown.bs.modal', function () { tinymce.init({ promotion: false, @@ -68,11 +70,11 @@ $(document).ready(function () { // Handle Saving changes to the page $('#savePage').click(() => { - frameContainer=$('#frameContainer').contents().get(0) + frameContainerElement=$('#frameContainer').contents().get(0); $.post("/cms/controller/", { action: "save", - uri: frameContainer.location.pathname, - content: new XMLSerializer().serializeToString(frameContainer) + uri: frameContainerElement.location.pathname, + content: new XMLSerializer().serializeToString(frameContainerElement) }, function (data) { if (typeof data.error == "undefined") { showMessage(data.message, "success"); -- 2.53.0