From 81a95b178e615802f13b9263b21a4903fddee2ad Mon Sep 17 00:00:00 2001 From: jk Date: Tue, 7 Sep 2021 13:11:27 +0100 Subject: [PATCH] tweaks --- public/editor-files/editor.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/editor-files/editor.js b/public/editor-files/editor.js index 0f249fa..04add5c 100644 --- a/public/editor-files/editor.js +++ b/public/editor-files/editor.js @@ -73,11 +73,12 @@ $(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: $("#post-image").val(), + image: image, body: editor.serialize().content.value, category: category, slug: $("#post-slug").val(), @@ -142,7 +143,7 @@ $(function() { function reset_page() { $("#post-name").val(''); $("#post-description").val(''); - $("#postimage").val(''); + $("#post-image").tokenfield('setTokens',[]); $("#post-slug").val(''); $("#post-tags").tokenfield('setTokens',[]); $("#post-status").val('published'); @@ -166,7 +167,7 @@ function doAutoSave() { var savedData = { title: $("#post-name").val(), description: $("#post-description").val(), - image: $("#post-image").val(), + image: $("#post-image").tokenfield('getTokensList'), body: editor.serialize().content.value, tags: $("#post-tags").tokenfield('getTokensList'), slug: $("#post-slug").val(),