Fix itemFiler() callback

- Remove page exit alert
- Update filed post display on success
- Reset cursor appearance always
This commit is contained in:
Hypolite Petovan 2025-01-26 14:42:21 -05:00
parent 9e3936b151
commit 1f8ea30735
2 changed files with 25 additions and 13 deletions

View file

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

View file

@ -312,14 +312,19 @@
const reply = $("#id_term").val(); const reply = $("#id_term").val();
if (reply && reply.length) { if (reply && reply.length) {
commentBusy = true; commentBusy = true;
formModified = true;
$('body').css('cursor', 'wait'); $('body').css('cursor', 'wait');
$.get('filer/' + id + '?term=' + reply, NavUpdate); $.get('filer/' + id + '?term=' + reply)
// if(timer) clearTimeout(timer); .done(function () {
// timer = setTimeout(NavUpdate,3000); $.colorbox.close();
liking = 1; resetFormModifiedFlag();
force_update = true; })
$.colorbox.close(); .always(function () {
formModified = true; // Mark the form as modified liking = 1;
force_update = true;
update_item = id;
NavUpdate();
});
} else { } else {
$("#id_term").css("border-color", "#FF0000"); $("#id_term").css("border-color", "#FF0000");
} }