Avoid JS error in advances search screen.
authorJan Schneider <jan@horde.org>
Thu, 28 May 2009 10:23:20 +0000 (12:23 +0200)
committerJan Schneider <jan@horde.org>
Thu, 28 May 2009 12:47:12 +0000 (14:47 +0200)
kronolith/templates/edit/javascript.inc

index a7c3100..6a65915 100644 (file)
@@ -257,6 +257,9 @@ Event.observe(window, 'load', function() {
 KronolithEventForm.toggleSection = function(section)
 {
     var dir = '<?php echo $GLOBALS['registry']->getImageDir() ?>';
+    if (!$('section_' + section)) {
+        return;
+    }
     $('section_' + section).toggle();
     if ($('section_' + section).visible()) {
         $('toggle_' + section).src = dir + '/minus.png';
@@ -273,11 +276,11 @@ KronolithEventForm.toggleSection = function(section)
     }
 }
 Event.observe(window, 'load', function() {
-       KronolithEventForm.toggleSection('alarm');
-       KronolithEventForm.toggleSection('description');
-       KronolithEventForm.toggleSection('attendees');
-       KronolithEventForm.toggleSection('recurrence');
-       KronolithEventForm.toggleSection('tags');
+    KronolithEventForm.toggleSection('alarm');
+    KronolithEventForm.toggleSection('description');
+    KronolithEventForm.toggleSection('attendees');
+    KronolithEventForm.toggleSection('recurrence');
+    KronolithEventForm.toggleSection('tags');
 });
 
 </script>