rem:  if( getFieldValue(alarmCheckBox, "checked" ) ) {   setFieldValue( alarmField, false, "disabled" ); setFieldValue( alarmMenu, false, "disabled" ); setFieldValue( alarmTrigger, false, "disabled" ); setFieldValue( alarmEmailField, false, "disabled" ); setFieldValue( alarmEmailCheckbox, false, "disabled" ); } else { setFieldValue( alarmField, true, "disabled" ); setFieldValue( alarmMenu, true, "disabled" ); setFieldValue( alarmTrigger, true, "disabled" ); setFieldValue( alarmEmailField, true, "disabled" ); setFieldValue( alarmEmailCheckbox, true, "disabled" ); } 
add:  var alarmDisabled = !(startChecked || dueChecked); setFieldValue("alarm-checkbox", alarmDisabled, "disabled");  if (alarmDisabled) setFieldValue("alarm-checkbox", false, "checked");  var alarmChecked = getFieldValue("alarm-checkbox", "checked" ); setFieldValue( "alarm-length-field", !alarmChecked, "disabled" ); setFieldValue( "alarm-length-units", !alarmChecked, "disabled" ); setFieldValue( "alarm-email-field", !alarmChecked, "disabled" ); setFieldValue( "alarm-email-checkbox", !alarmChecked, "disabled" );   if (startChecked && !dueChecked) { menuListFieldSelectItem("alarm-trigger-relation", "ICAL_RELATED_START"); } else if (!startChecked && dueChecked) { menuListFieldSelectItem("alarm-trigger-relation", "ICAL_RELATED_END"); }   var triggerChoiceEnabled = alarmChecked && startChecked && dueChecked; setFieldValue("alarm-trigger-relation", !triggerChoiceEnabled, "disabled"); 
context: function updateAlarmItemEnabled(){   var alarmCheckBox = "alarm-checkbox";      var alarmField = "alarm-length-field";   var alarmMenu = "alarm-length-units";   var alarmTrigger = "alarm-trigger-relation";         var alarmEmailCheckbox = "alarm-email-checkbox";   var alarmEmailField = "alarm-email-field";//   if( getFieldValue(alarmCheckBox, "checked" ) || getFieldValue( alarmEmailCheckbox, "checked" ) )   if( getFieldValue(alarmCheckBox, "checked" ) )   {      // call remove attribute beacuse some widget code checks for the presense of a       // disabled attribute, not the value.      setFieldValue( alarmField, false, "disabled" );      setFieldValue( alarmMenu, false, "disabled" );      setFieldValue( alarmTrigger, false, "disabled" );      setFieldValue( alarmEmailField, false, "disabled" );      setFieldValue( alarmEmailCheckbox, false, "disabled" );   }   else   {      setFieldValue( alarmField, true, "disabled" );      setFieldValue( alarmMenu, true, "disabled" );      setFieldValue( alarmTrigger, true, "disabled" );      setFieldValue( alarmEmailField, true, "disabled" );      setFieldValue( alarmEmailCheckbox, true, "disabled" );   }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/aa1fa5579d9a13bb9682461830212847418672e6/toDoDialog.js/buggy/calendar/resources/content/toDoDialog.js