Revert accidental commit and apply correct code #26

Merged
andydixon merged 1 commits from development into master 2024-10-09 21:36:48 +02:00
+8 -6
View File
@@ -18,9 +18,11 @@ $(document).ready(function () {
// Get the content of the div // Get the content of the div
var content = currentDiv.html(); var content = currentDiv.html();
// Set the content in TinyMCE, Show the modal and initialise TinyMCE // Set the content in TinyMCE
$('#editor').val(content) $('#editor').val(content);
.modal('show')
// Open the modal and init tinyMCE
$('#editModal').modal('show')
.on('shown.bs.modal', function () { .on('shown.bs.modal', function () {
tinymce.init({ tinymce.init({
promotion: false, promotion: false,
@@ -68,11 +70,11 @@ $(document).ready(function () {
// Handle Saving changes to the page // Handle Saving changes to the page
$('#savePage').click(() => { $('#savePage').click(() => {
frameContainer=$('#frameContainer').contents().get(0) frameContainerElement=$('#frameContainer').contents().get(0);
$.post("/cms/controller/", { $.post("/cms/controller/", {
action: "save", action: "save",
uri: frameContainer.location.pathname, uri: frameContainerElement.location.pathname,
content: new XMLSerializer().serializeToString(frameContainer) content: new XMLSerializer().serializeToString(frameContainerElement)
}, function (data) { }, function (data) {
if (typeof data.error == "undefined") { if (typeof data.error == "undefined") {
showMessage(data.message, "success"); showMessage(data.message, "success");