From: Jan Schneider Date: Fri, 12 Feb 2010 13:32:50 +0000 (+0100) Subject: Always and consitently reset edit forms before deciding whether to load date X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2a6a4e210cd6ff85bd55bc9dece271ad3e5885ad;p=horde.git Always and consitently reset edit forms before deciding whether to load date into them. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 552334158..00822ea5c 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -1826,6 +1826,11 @@ KronolithCore = { RedBox.onDisplay = null; }; + $('kronolithTaskForm').enable(); + $('kronolithTaskForm').reset(); + $('kronolithTaskSave').show(); + $('kronolithTaskDelete').show(); + $('kronolithTaskForm').down('.kronolithFormActions').down('.kronolithSep').show(); this.updateTasklistDropDown(); if (id) { RedBox.loading(); @@ -1834,16 +1839,9 @@ KronolithCore = { $('kronolithTaskId').clear(); $('kronolithTaskOldList').clear(); $('kronolithTaskList').setValue(Kronolith.conf.tasks.default_tasklist); - $('kronolithTaskTitle').clear(); //$('kronolithTaskLocation').setValue('http://'); - $('kronolithTaskDueDate').clear(); - $('kronolithTaskDueTime').clear(); - $('kronolithTaskDescription').clear(); $('kronolithTaskPriority').setValue(3); - $('kronolithTaskCompleted').setValue(0); $('kronolithTaskDelete').hide(); - $('kronolithTaskSave').show(); - $('kronolithTaskForm').enable(); RedBox.showHtml($('kronolithTaskDialog').show()); } }, @@ -1871,13 +1869,9 @@ KronolithCore = { //$('kronolithTaskLocation').setValue(task.l); if (task.dd) { $('kronolithTaskDueDate').setValue(task.dd); - } else { - $('kronolithTaskDueDate').clear(); } if (task.dt) { $('kronolithTaskDueTime').setValue(task.dt); - } else { - $('kronolithTaskDueTime').clear(); } $('kronolithTaskDescription').setValue(task.de); $('kronolithTaskPriority').setValue(task.pr); @@ -1897,21 +1891,14 @@ KronolithCore = { $('kronolithEventAlarmOff').setValue(true); } - if (task.pe) { - $('kronolithTaskSave').show(); - $('kronolithTaskForm').enable(); - } else { + if (!task.pe) { $('kronolithTaskSave').hide(); $('kronolithTaskForm').disable(); } - if (task.pd) { + if (!task.pd) { $('kronolithTaskDelete').show(); - } else { - $('kronolithTaskDelete').hide(); } - if (task.pe || task.pd) { - $('kronolithTaskForm').down('.kronolithFormActions').down('.kronolithSep').show(); - } else { + if (!task.pe && !task.pd) { $('kronolithTaskForm').down('.kronolithFormActions').down('.kronolithSep').hide(); } @@ -3244,6 +3231,9 @@ KronolithCore = { this.updateCalendarDropDown('kronolithEventTarget'); $('kronolithEventForm').enable(); $('kronolithEventForm').reset(); + $('kronolithEventSave').show(); + $('kronolithEventDelete').show(); + $('kronolithEventForm').down('.kronolithFormActions').down('.kronolithSep').show(); this.doAction('ListTopTags', {}, this._topTags); if (id) { RedBox.loading(); @@ -3468,21 +3458,14 @@ KronolithCore = { $('kronolithEventLocationLon').value = ev.gl.lon; } - if (ev.pe) { - $('kronolithEventSave').show(); - $('kronolithEventForm').enable(); - } else { + if (!ev.pe) { $('kronolithEventSave').hide(); $('kronolithEventForm').disable(); } - if (ev.pd) { - $('kronolithEventDelete').show(); - } else { + if (!ev.pd) { $('kronolithEventDelete').hide(); } - if (ev.pe || ev.pd) { - $('kronolithEventForm').down('.kronolithFormActions').down('.kronolithSep').show(); - } else { + if (!ev.pe && !ev.pd) { $('kronolithEventForm').down('.kronolithFormActions').down('.kronolithSep').hide(); }