Added confirmation dialog before deleting an attachment

This commit is contained in:
2017-11-08 16:16:38 +01:00
parent e41cb58950
commit 4c184eb83f
2 changed files with 9 additions and 7 deletions
+8 -6
View File
@@ -47,9 +47,11 @@ function onReady()
delete imReq;
}
function deleteAtt(idx)
{
submitted = true;
document.form1.smcmd.value='delatt'+idx;
document.form1.submit();
}
function deleteAtt(idx, str)
{
if (confirm(str) == true) {
submitted = true;
document.form1.smcmd.value='delatt'+idx;
document.form1.submit();
}
}
+1 -1
View File
@@ -11942,7 +11942,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
sprintf(str, "im('att'+'%d','%s','%s','rotright');", index, thumb_name, att[index]);
ricon("rotright", loc("Rotate right"), str);
rsprintf(" \n");
sprintf(str, "deleteAtt('%d')", index);
sprintf(str, "deleteAtt('%d','%s')", index, loc("Are you sure to delete the attachment?"));
ricon("delatt", loc("Delete attachment"), str);
rsprintf("  \n");