diff --git a/view/templates/jot-header.tpl b/view/templates/jot-header.tpl index 5276bf5d5e..10d3ce450f 100644 --- a/view/templates/jot-header.tpl +++ b/view/templates/jot-header.tpl @@ -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; }); }); diff --git a/view/theme/frio/templates/jot-header.tpl b/view/theme/frio/templates/jot-header.tpl index d1fdc3dee0..9afb2ac559 100644 --- a/view/theme/frio/templates/jot-header.tpl +++ b/view/theme/frio/templates/jot-header.tpl @@ -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); - 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"); }