diff --git a/src/elogd.c b/src/elogd.c
index c9250393..2ad978bd 100755
--- a/src/elogd.c
+++ b/src/elogd.c
@@ -10308,14 +10308,19 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
rsprintf(" window.status = \"%s\";\n", loc("Entry has been modified"));
rsprintf(" document.form1.entry_modified.value = \"1\";\n");
rsprintf(" document.title = '%s - %s';\n", page_title, loc("Edited"));
+ rsprintf(" if (document.getElementById('restore') != undefined)\n");
+ rsprintf(" document.getElementById('restore').disabled = false;\n");
rsprintf("}\n\n");
rsprintf("function checkText()\n");
rsprintf("{\n");
if (autosave) {
// CKEDITOR cannot call mod(), so manually check if text has changed
- rsprintf(" if (checkTextTimer != null)\n");
- rsprintf(" clearTimeout(checkTextTimer);\n");
+ rsprintf(" if (checkTextTimer == null) {\n");
+ rsprintf(" checkTextTimer = setTimeout(checkText, 1000);\n");
+ rsprintf(" return;\n");
+ rsprintf(" }\n");
+ rsprintf(" clearTimeout(checkTextTimer);\n");
rsprintf(" if (typeof(CKEDITOR) != 'undefined')\n");
rsprintf(" t = CKEDITOR.instances.Text.getData();\n");
rsprintf(" else\n");
@@ -10561,8 +10566,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
rsprintf("\n",
loc("Preview"));
- if (!getcfg(lbs->name, "Show text", str, sizeof(str)) || atoi(str) == 1)
- rsprintf("\n",
+ if (message_id && (!getcfg(lbs->name, "Show text", str, sizeof(str)) || atoi(str) == 1))
+ rsprintf("\n",
loc("Restore"));
if (!getcfg(lbs->name, "Save drafts", str, sizeof(str)) || atoi(str) == 1)