]> git.mxchange.org Git - friendica.git/commitdiff
[frio] Disable unexpected asynchronous compose form submission
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 26 May 2020 13:24:08 +0000 (09:24 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 26 May 2020 14:28:30 +0000 (10:28 -0400)
view/theme/frio/js/theme.js

index b64c7d02026179adcd6b5957a68cf7630fe57f67..3a3f02c5e5f239ac379592bbff86be1de5953d5e 100644 (file)
@@ -112,10 +112,8 @@ $(document).ready(function(){
                }
        });
 
-       //$('ul.flex-nav').flexMenu();
-
        // initialize the bootstrap tooltips
-       $('body').tooltip({
+       $body.tooltip({
                selector: '[data-toggle="tooltip"]',
                container: 'body',
                animation: true,
@@ -364,10 +362,17 @@ $(document).ready(function(){
 
        // Comment form submit
        $body.on('submit', '.comment-edit-form', function(e) {
+               let id = $form.data('item-id');
+
+               // Compose page form exception: id is always 0 and form must not be submitted asynchronously
+               if (id === 0) {
+                       return;
+               }
+
                e.preventDefault();
 
                let $form = $(this);
-               let id = $form.data('item-id');
+
                let $commentSubmit = $form.find('.comment-edit-submit').button('loading');
 
                unpause();