]> git.mxchange.org Git - friendica.git/commitdiff
Fix itemFiler() callback
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Jan 2025 19:42:21 +0000 (14:42 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 28 Jan 2025 12:50:16 +0000 (07:50 -0500)
- Remove page exit alert
- Update filed post display on success
- Reset cursor appearance always

view/templates/jot-header.tpl
view/theme/frio/templates/jot-header.tpl

index 5276bf5d5e3cc297a16370d383cbdc9b6740723a..10d3ce450f758e680c12758d76272eaae59608c1 100644 (file)
@@ -215,16 +215,23 @@ function enableOnUser(){
                                const reply = $("#id_term").val();
                                if (reply && reply.length) {
                                        commentBusy = true;
+                                       formModified = true;
                                        $('body').css('cursor', 'wait');
-                                       $.get('filer/' + id + '?term=' + reply, NavUpdate);
-//                                     if(timer) clearTimeout(timer);
-//                                     timer = setTimeout(NavUpdate,3000);
-                                       liking = 1;
-                                       force_update = true;
-                                       $.colorbox.close();
+                                       $.get('filer/' + id + '?term=' + reply)
+                                               .done(function () {
+                                                       $.colorbox.close();
+                                                       resetFormModifiedFlag();
+                                               })
+                                               .always(function () {
+                                                       liking = 1;
+                                                       force_update = true;
+                                                       update_item = id;
+                                                       NavUpdate();
+                                               });
                                } else {
                                        $("#id_term").css("border-color", "#FF0000");
                                }
+
                                return false;
                        });
                });
index d1fdc3dee07fbf20f60a3a2464f3421f37ac1cb2..9afb2ac55926e56636f236b59b03d95bc4e85c80 100644 (file)
                                const reply = $("#id_term").val();
                                if (reply && reply.length) {
                                        commentBusy = true;
+                                       formModified = true;
                                        $('body').css('cursor', 'wait');
-                                       $.get('filer/' + id + '?term=' + reply, NavUpdate);
-//                                     if(timer) clearTimeout(timer);
-//                                     timer = setTimeout(NavUpdate,3000);
-                                       liking = 1;
-                                       force_update = true;
-                                       $.colorbox.close();
-                                       formModified = true; // Mark the form as modified
+                                       $.get('filer/' + id + '?term=' + reply)
+                                               .done(function () {
+                                                       $.colorbox.close();
+                                                       resetFormModifiedFlag();
+                                               })
+                                               .always(function () {
+                                                       liking = 1;
+                                                       force_update = true;
+                                                       update_item = id;
+                                                       NavUpdate();
+                                               });
                                } else {
                                        $("#id_term").css("border-color", "#FF0000");
                                }