]> git.mxchange.org Git - friendica.git/commitdiff
Ensure the preview parameter is set to 1 when doing a preview
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 28 Nov 2019 17:47:53 +0000 (12:47 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 28 Nov 2019 17:54:56 +0000 (12:54 -0500)
- The element #jot-preview might not exist

view/js/main.js

index 94644c5dfd2c3467d796b6449f71959cb8e89d6e..e15ee77e19592d9c6b4b727e922aff52851114b4 100644 (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;
 }