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();
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);
$.get('filer/' + id + '?term=' + reply)
.done(function () {
$.colorbox.close();
resetFormModifiedFlag();
})
.always(function () {
liking = 1;
force_update = true;
$.colorbox.close();
update_item = id;
NavUpdate();
});
} else {
$("#id_term").css("border-color", "#FF0000");
}
return false;
});
});

View file

@ -312,14 +312,19 @@
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);
$.get('filer/' + id + '?term=' + reply)
.done(function () {
$.colorbox.close();
resetFormModifiedFlag();
})
.always(function () {
liking = 1;
force_update = true;
$.colorbox.close();
formModified = true; // Mark the form as modified
update_item = id;
NavUpdate();
});
} else {
$("#id_term").css("border-color", "#FF0000");
}