From cf8b322f32ede09ddefd35ece70927e699a07ba9 Mon Sep 17 00:00:00 2001 From: jk Date: Tue, 7 Sep 2021 13:15:00 +0100 Subject: [PATCH] tweaks --- public/editor-files/editor.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/public/editor-files/editor.js b/public/editor-files/editor.js index 04add5c..016fa43 100644 --- a/public/editor-files/editor.js +++ b/public/editor-files/editor.js @@ -73,12 +73,11 @@ $(function() { $('#publish-fields').addClass('hidden'); var category = $("#post-tags").tokenfield("getTokens").map(function(t){ return t.value}); - var image = $("#post-image").tokenfield("getTokens").map(function(t){ return t.value}); - + $.post('/editor/publish', { name: $("#post-name").val(), description: $("#post-description").val(), - image: image, + image: $("#post-image").val(), body: editor.serialize().content.value, category: category, slug: $("#post-slug").val(), @@ -143,7 +142,7 @@ $(function() { function reset_page() { $("#post-name").val(''); $("#post-description").val(''); - $("#post-image").tokenfield('setTokens',[]); + $("#post-image").val(''); $("#post-slug").val(''); $("#post-tags").tokenfield('setTokens',[]); $("#post-status").val('published'); @@ -167,7 +166,7 @@ function doAutoSave() { var savedData = { title: $("#post-name").val(), description: $("#post-description").val(), - image: $("#post-image").tokenfield('getTokensList'), + image: $("#post-image").val(), body: editor.serialize().content.value, tags: $("#post-tags").tokenfield('getTokensList'), slug: $("#post-slug").val(),