Ensure the preview parameter is set to 1 when doing a preview

- The element #jot-preview might not exist
This commit is contained in:
Hypolite Petovan 2019-11-28 12:47:53 -05:00
parent b64b18e6f7
commit e8f91d7e54

View file

@ -764,11 +764,10 @@ function showHideComments(id) {
}
function preview_post() {
$("#jot-preview").val("1");
$("#jot-preview-content").show();
$.post(
"item",
$("#profile-jot-form").serialize(),
$("#profile-jot-form").serialize() + '&preview=1',
function(data) {
if (data.preview) {
$("#jot-preview-content").html(data.preview);
@ -778,7 +777,6 @@ function preview_post() {
},
"json"
);
$("#jot-preview").val("0");
return true;
}